From d110bf2e28573f25ee0ab91766fee0f67e6346ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 02:58:54 +0000 Subject: [PATCH 1/3] build(deps): bump golangci/golangci-lint-action from 6 to 7 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v6...v7) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/golangci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 3e065a8..7a26a48 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -20,7 +20,7 @@ jobs: check-latest: true cache: false - name: golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v7 with: version: latest args: --timeout=10m From e7ffa6bd9a3821c2d5f316a5ee0212e3435a3341 Mon Sep 17 00:00:00 2001 From: David Dymko Date: Fri, 18 Apr 2025 21:00:20 -0400 Subject: [PATCH 2/3] ci: fix golangci-lint --- .github/workflows/golangci-lint.yml | 2 +- .golangci.yml | 7 ++++++- pkg/cmd/conditioner.go | 8 +++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 7a26a48..1ae792d 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -22,5 +22,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v7 with: - version: latest + version: v2.1.2 args: --timeout=10m diff --git a/.golangci.yml b/.golangci.yml index bce61a6..6bb06c5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,11 @@ # https://golangci-lint.run/usage/configuration/ # https://golangci-lint.run/usage/linters/ +version: "2" linters: + enable: + - gocyclo + +formatters: enable: - gofumpt - - goimports + - goimports \ No newline at end of file diff --git a/pkg/cmd/conditioner.go b/pkg/cmd/conditioner.go index 35591a0..fbc2f82 100644 --- a/pkg/cmd/conditioner.go +++ b/pkg/cmd/conditioner.go @@ -146,12 +146,14 @@ func (o *ConditionOptions) Complete(cmd *cobra.Command, _ []string, config *conf return err } - if status == "true" { + switch status { + case "true": o.condition.Status = corev1.ConditionTrue - } else if status == "false" { + case "false": o.condition.Status = corev1.ConditionFalse - } else { + default: o.condition.Status = corev1.ConditionUnknown + } o.condition.Reason, err = cmd.Flags().GetString("reason") From a6c081f5ee7cd5d5407765b1430772db62df25bf Mon Sep 17 00:00:00 2001 From: David Dymko Date: Sat, 19 Apr 2025 13:49:24 -0400 Subject: [PATCH 3/3] chore: newline --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 6bb06c5..e8cf980 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,4 +8,4 @@ linters: formatters: enable: - gofumpt - - goimports \ No newline at end of file + - goimports