diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 3e065a8..1ae792d 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 + version: v2.1.2 args: --timeout=10m diff --git a/.golangci.yml b/.golangci.yml index bce61a6..e8cf980 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 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")