From ab3e43c4cf0b2e15dff66bb1a612675c6f4d5217 Mon Sep 17 00:00:00 2001 From: Marko Bevc Date: Wed, 24 Jun 2026 13:39:43 +0100 Subject: [PATCH] chore: align compliance status messages to NON-COMPLIANT For ENV and snapshot assertions the CLI printed INCOMPLIANT, which did not match the NON-COMPLIANT framing used in the UI and elsewhere in the CLI. Align the wording in `assert snapshot` and `get environment`. Closes #969 --- cmd/kosli/assertSnapshot.go | 2 +- cmd/kosli/assertSnapshot_test.go | 4 ++-- cmd/kosli/getEnvironment.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/kosli/assertSnapshot.go b/cmd/kosli/assertSnapshot.go index dac6d117f..c521d39a3 100644 --- a/cmd/kosli/assertSnapshot.go +++ b/cmd/kosli/assertSnapshot.go @@ -87,7 +87,7 @@ func run(out io.Writer, args []string) error { if environmentData["compliant"].(bool) { logger.Info("COMPLIANT") } else { - return fmt.Errorf("INCOMPLIANT") + return fmt.Errorf("NON-COMPLIANT") } return nil diff --git a/cmd/kosli/assertSnapshot_test.go b/cmd/kosli/assertSnapshot_test.go index 8e1db7705..5e42a89e4 100644 --- a/cmd/kosli/assertSnapshot_test.go +++ b/cmd/kosli/assertSnapshot_test.go @@ -83,13 +83,13 @@ func (suite *AssertSnapshotCommandTestSuite) TestAssertSnapshotCmd() { }, { wantError: true, - name: "04 asserting a non compliant env results in INCOMPLIANT and non-zero exit", + name: "04 asserting a non compliant env results in NON-COMPLIANT and non-zero exit", cmd: fmt.Sprintf(`assert snapshot %s %s`, suite.nonCompliantEnvName, suite.defaultKosliArguments), additionalConfig: assertSnapshotTestConfig{ reportToEnv: true, envName: suite.nonCompliantEnvName, }, - golden: "Error: INCOMPLIANT\n", + golden: "Error: NON-COMPLIANT\n", }, { wantError: false, diff --git a/cmd/kosli/getEnvironment.go b/cmd/kosli/getEnvironment.go index 3e1473d02..365dccd97 100644 --- a/cmd/kosli/getEnvironment.go +++ b/cmd/kosli/getEnvironment.go @@ -83,7 +83,7 @@ func printEnvironmentAsTable(raw string, out io.Writer, page int) error { if env["state"] != nil && env["state"].(bool) { state = "COMPLIANT" } else if env["state"] != nil { - state = "INCOMPLIANT" + state = "NON-COMPLIANT" } tags := env["tags"].(map[string]interface{})