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

chore: enable wastedassign linter (#3898)

Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-05-12 13:03:26 +02:00 committed by GitHub
parent bd78f02510
commit 26a5402747
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

@ -25,6 +25,7 @@ linters:
- unconvert
- unused
- varcheck
- wastedassign
- whitespace
run:

View file

@ -90,7 +90,7 @@ func ProcessDeletePolicyForCloneGenerateRule(policy kyverno.PolicyInterface, cli
logger.V(4).Info("generate policy with clone, remove policy name from label of source resource")
generatePolicyWithClone = true
retryCount := 0
var retryCount int
for retryCount < 5 {
err := updateSourceResource(policy.GetName(), rule, client, logger)
if err != nil {
@ -114,7 +114,7 @@ func updateSourceResource(pName string, rule kyverno.Rule, client dclient.Interf
return errors.Wrapf(err, "source resource %s/%s/%s not found", rule.Generation.Kind, rule.Generation.Clone.Namespace, rule.Generation.Clone.Name)
}
update := false
var update bool
labels := obj.GetLabels()
update, labels = removePolicyFromLabels(pName, labels)
if !update {

View file

@ -85,7 +85,7 @@ func (c *changeRequestCreator) add(request *unstructured.Unstructured) {
}
func (c *changeRequestCreator) create(request *unstructured.Unstructured) error {
ns := ""
var ns string
if request.GetKind() == "ReportChangeRequest" {
ns = config.KyvernoNamespace()
rcr, err := convertToRCR(request)