1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +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
- noctx
- nolintlint
- nosprintfhostport
- paralleltest
- staticcheck
- 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 {
newForeachValidate := make([]kyvernov1.ForEachValidation, len(rule.Validation.ForEachValidation))
for i, foreach := range rule.Validation.ForEachValidation {
newForeachValidate[i] = foreach
}
copy(newForeachValidate, rule.Validation.ForEachValidation)
rule.Validation = kyvernov1.Validation{
Message: variables.FindAndShiftReferences(logger, rule.Validation.Message, shift, "pattern"),
ForEachValidation: newForeachValidate,