1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

chore: enable more linters (#3862)

* chore: enable deadcode and unused linters

Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>

* chore: enable more linters

Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-05-10 17:50:04 +02:00 committed by GitHub
parent d982ef77b3
commit bfc4290285
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 15 deletions

View file

@ -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"
- ".+_test_.+.go"

View file

@ -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

View file

@ -199,7 +199,6 @@ func GenerateRulePatches(spec *kyverno.Spec, controllers string) (rulePatches []
rulePatches = append(rulePatches, pbytes)
}
insertIdx++
patchPostion = insertIdx
}
}
return

View file

@ -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 {

View file

@ -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)