1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

Fixed typo "anchoredEtries"

This commit is contained in:
Denis Belyshev 2019-06-18 13:07:55 +03:00
parent ed7dfb63d6
commit e467b596e1

View file

@ -111,9 +111,9 @@ func NewExistanceAnchorValidationHandler(anchor string, pattern interface{}, pat
// Handle performs validation in context of ExistanceAnchorValidationHandler
func (eavh *ExistanceAnchorValidationHandler) Handle(resourcePart []interface{}, patternPart map[string]interface{}) result.RuleApplicationResult {
anchoredEtries, handlingResult := handleConditionCases(resourcePart, patternPart, eavh.anchor, eavh.pattern, eavh.path)
anchoredEntries, handlingResult := handleConditionCases(resourcePart, patternPart, eavh.anchor, eavh.pattern, eavh.path)
if 0 == anchoredEtries {
if 0 == anchoredEntries {
handlingResult.FailWithMessagef("Existance anchor %s used, but no suitable entries were found", eavh.anchor)
}
@ -133,10 +133,10 @@ func checkForAnchorCondition(anchor string, pattern interface{}, resourceMap map
// both () and ^() are checking conditions and have a lot of similar logic
// the only difference is that ^() requires existace of one element
// anchoredEtries var counts this occurences.
// anchoredEntries var counts this occurences.
func handleConditionCases(resourcePart []interface{}, patternPart map[string]interface{}, anchor string, pattern interface{}, path string) (int, result.RuleApplicationResult) {
handlingResult := result.NewRuleApplicationResult("")
anchoredEtries := 0
anchoredEntries := 0
for i, resourceElement := range resourcePart {
currentPath := path + strconv.Itoa(i) + "/"
@ -151,10 +151,10 @@ func handleConditionCases(resourcePart []interface{}, patternPart map[string]int
continue
}
anchoredEtries++
anchoredEntries++
res := validateMap(typedResourceElement, patternPart, currentPath)
handlingResult.MergeWith(&res)
}
return anchoredEtries, handlingResult
return anchoredEntries, handlingResult
}