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:
parent
bd78f02510
commit
26a5402747
3 changed files with 4 additions and 3 deletions
|
@ -25,6 +25,7 @@ linters:
|
|||
- unconvert
|
||||
- unused
|
||||
- varcheck
|
||||
- wastedassign
|
||||
- whitespace
|
||||
|
||||
run:
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue