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:
parent
d982ef77b3
commit
bfc4290285
5 changed files with 15 additions and 15 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -199,7 +199,6 @@ func GenerateRulePatches(spec *kyverno.Spec, controllers string) (rulePatches []
|
|||
rulePatches = append(rulePatches, pbytes)
|
||||
}
|
||||
insertIdx++
|
||||
patchPostion = insertIdx
|
||||
}
|
||||
}
|
||||
return
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue