1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-15 20:20:22 +00:00

chore: enable nosprintfhostport linter (#3989)

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

Co-authored-by: Prateek Pandey <prateek.pandey@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-05-23 16:14:52 +02:00 committed by GitHub
parent dd4fd943b1
commit 005400c606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -28,6 +28,7 @@ linters:
- misspell - misspell
- noctx - noctx
- nolintlint - nolintlint
- nosprintfhostport
- paralleltest - paralleltest
- staticcheck - staticcheck
- structcheck - structcheck

View file

@ -171,9 +171,7 @@ func generateRule(name string, rule *kyvernov1.Rule, tplKey, shift string, kinds
} }
if len(rule.Validation.ForEachValidation) > 0 && rule.Validation.ForEachValidation != nil { if len(rule.Validation.ForEachValidation) > 0 && rule.Validation.ForEachValidation != nil {
newForeachValidate := make([]kyvernov1.ForEachValidation, len(rule.Validation.ForEachValidation)) newForeachValidate := make([]kyvernov1.ForEachValidation, len(rule.Validation.ForEachValidation))
for i, foreach := range rule.Validation.ForEachValidation { copy(newForeachValidate, rule.Validation.ForEachValidation)
newForeachValidate[i] = foreach
}
rule.Validation = kyvernov1.Validation{ rule.Validation = kyvernov1.Validation{
Message: variables.FindAndShiftReferences(logger, rule.Validation.Message, shift, "pattern"), Message: variables.FindAndShiftReferences(logger, rule.Validation.Message, shift, "pattern"),
ForEachValidation: newForeachValidate, ForEachValidation: newForeachValidate,