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:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
|
- bodyclose
|
||||||
- deadcode
|
- deadcode
|
||||||
- errcheck
|
- errcheck
|
||||||
- gosec
|
- gosec
|
||||||
- gosimple
|
- gosimple
|
||||||
- bodyclose
|
- govet
|
||||||
- staticcheck
|
|
||||||
- unused
|
|
||||||
disable:
|
|
||||||
- ineffassign
|
- ineffassign
|
||||||
|
- staticcheck
|
||||||
- structcheck
|
- structcheck
|
||||||
|
- typecheck
|
||||||
|
- unused
|
||||||
|
- varcheck
|
||||||
|
|
||||||
run:
|
run:
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
skip-files:
|
skip-files:
|
||||||
- ".+_test.go"
|
- ".+_test.go"
|
||||||
- ".+_test_.+.go"
|
- ".+_test_.+.go"
|
||||||
|
|
|
@ -107,13 +107,13 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
requests := []request{
|
requests := []request{
|
||||||
{policyReportKind, ""},
|
{policyReportKind},
|
||||||
{clusterPolicyReportKind, ""},
|
{clusterPolicyReportKind},
|
||||||
|
|
||||||
{reportChangeRequestKind, ""},
|
{reportChangeRequestKind},
|
||||||
{clusterReportChangeRequestKind, ""},
|
{clusterReportChangeRequestKind},
|
||||||
|
|
||||||
{convertGenerateRequest, ""},
|
{convertGenerateRequest},
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
@ -253,7 +253,6 @@ func executeRequest(client client.Interface, kyvernoclient kyvernoclient.Interfa
|
||||||
|
|
||||||
type request struct {
|
type request struct {
|
||||||
kind string
|
kind string
|
||||||
name string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Processing Pipeline
|
/* Processing Pipeline
|
||||||
|
|
|
@ -199,7 +199,6 @@ func GenerateRulePatches(spec *kyverno.Spec, controllers string) (rulePatches []
|
||||||
rulePatches = append(rulePatches, pbytes)
|
rulePatches = append(rulePatches, pbytes)
|
||||||
}
|
}
|
||||||
insertIdx++
|
insertIdx++
|
||||||
patchPostion = insertIdx
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
@ -405,7 +405,7 @@ func GenerateRootCASecretName(props *CertificateProps) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func CanAddAnnotationToSecret(deplHash string, secret *v1.Secret) bool {
|
func CanAddAnnotationToSecret(deplHash string, secret *v1.Secret) bool {
|
||||||
var deplHashSec string = "default"
|
var deplHashSec string
|
||||||
var ok, managedByKyverno bool
|
var ok, managedByKyverno bool
|
||||||
|
|
||||||
if label, ok := secret.GetLabels()[ManagedByLabel]; ok {
|
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())
|
deplHash = fmt.Sprintf("%v", depl.GetUID())
|
||||||
}
|
}
|
||||||
|
|
||||||
var deplHashSec string = "default"
|
var deplHashSec string
|
||||||
var ok, managedByKyverno bool
|
var ok, managedByKyverno bool
|
||||||
|
|
||||||
sname := GenerateRootCASecretName(certProps)
|
sname := GenerateRootCASecretName(certProps)
|
||||||
|
@ -68,7 +68,7 @@ func ReadTLSPair(restConfig *rest.Config, client kubernetes.Interface) (*PemPair
|
||||||
deplHash = fmt.Sprintf("%v", depl.GetUID())
|
deplHash = fmt.Sprintf("%v", depl.GetUID())
|
||||||
}
|
}
|
||||||
|
|
||||||
var deplHashSec string = "default"
|
var deplHashSec string
|
||||||
var ok, managedByKyverno bool
|
var ok, managedByKyverno bool
|
||||||
|
|
||||||
sname := GenerateTLSPairSecretName(certProps)
|
sname := GenerateTLSPairSecretName(certProps)
|
||||||
|
|
Loading…
Reference in a new issue