diff --git a/.golangci.yml b/.golangci.yml index 07c95c6297..bc71d7ce09 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,18 +1,20 @@ linters: enable: + - bodyclose - deadcode - errcheck - gosec - gosimple - - bodyclose - - staticcheck - - unused - disable: + - govet - ineffassign + - staticcheck - structcheck + - typecheck + - unused + - varcheck run: timeout: 5m skip-files: - ".+_test.go" - - ".+_test_.+.go" \ No newline at end of file + - ".+_test_.+.go" diff --git a/cmd/initContainer/main.go b/cmd/initContainer/main.go index fe2098abde..7c76f67e73 100644 --- a/cmd/initContainer/main.go +++ b/cmd/initContainer/main.go @@ -107,13 +107,13 @@ func main() { } requests := []request{ - {policyReportKind, ""}, - {clusterPolicyReportKind, ""}, + {policyReportKind}, + {clusterPolicyReportKind}, - {reportChangeRequestKind, ""}, - {clusterReportChangeRequestKind, ""}, + {reportChangeRequestKind}, + {clusterReportChangeRequestKind}, - {convertGenerateRequest, ""}, + {convertGenerateRequest}, } ctx, cancel := context.WithCancel(context.Background()) @@ -253,7 +253,6 @@ func executeRequest(client client.Interface, kyvernoclient kyvernoclient.Interfa type request struct { kind string - name string } /* Processing Pipeline diff --git a/pkg/autogen/autogen.go b/pkg/autogen/autogen.go index bb84883532..670f8e5600 100644 --- a/pkg/autogen/autogen.go +++ b/pkg/autogen/autogen.go @@ -199,7 +199,6 @@ func GenerateRulePatches(spec *kyverno.Spec, controllers string) (rulePatches [] rulePatches = append(rulePatches, pbytes) } insertIdx++ - patchPostion = insertIdx } } return diff --git a/pkg/tls/certRenewer.go b/pkg/tls/certRenewer.go index 11a9a26e1f..f9f3370b00 100644 --- a/pkg/tls/certRenewer.go +++ b/pkg/tls/certRenewer.go @@ -405,7 +405,7 @@ func GenerateRootCASecretName(props *CertificateProps) string { } func CanAddAnnotationToSecret(deplHash string, secret *v1.Secret) bool { - var deplHashSec string = "default" + var deplHashSec string var ok, managedByKyverno bool if label, ok := secret.GetLabels()[ManagedByLabel]; ok { diff --git a/pkg/tls/reader.go b/pkg/tls/reader.go index 77bb2d247c..a25bcd448d 100644 --- a/pkg/tls/reader.go +++ b/pkg/tls/reader.go @@ -29,7 +29,7 @@ func ReadRootCASecret(restConfig *rest.Config, client kubernetes.Interface) (res deplHash = fmt.Sprintf("%v", depl.GetUID()) } - var deplHashSec string = "default" + var deplHashSec string var ok, managedByKyverno bool sname := GenerateRootCASecretName(certProps) @@ -68,7 +68,7 @@ func ReadTLSPair(restConfig *rest.Config, client kubernetes.Interface) (*PemPair deplHash = fmt.Sprintf("%v", depl.GetUID()) } - var deplHashSec string = "default" + var deplHashSec string var ok, managedByKyverno bool sname := GenerateTLSPairSecretName(certProps)