diff --git a/pkg/engine/anchor/anchor.go b/pkg/engine/anchor/anchor.go index b1127ad4e0..bf98147333 100644 --- a/pkg/engine/anchor/anchor.go +++ b/pkg/engine/anchor/anchor.go @@ -153,7 +153,7 @@ func (ch ConditionAnchorHandler) Handle(handler resourceElementHandler, resource // validate the values of the pattern returnPath, err := handler(log.Log, value, ch.pattern, originPattern, currentPath, ac) if err != nil { - ac.AnchorError = common.NewConditionalAnchorError(fmt.Sprintf("condition anchor did not satisfy: %s", err.Error())) + ac.AnchorError = common.NewConditionalAnchorError(err.Error()) return returnPath, ac.AnchorError.Error() } return "", nil @@ -187,7 +187,7 @@ func (gh GlobalAnchorHandler) Handle(handler resourceElementHandler, resourceMap // validate the values of the pattern returnPath, err := handler(log.Log, value, gh.pattern, originPattern, currentPath, ac) if err != nil { - ac.AnchorError = common.NewGlobalAnchorError(fmt.Sprintf("global anchor did not satisfy: %s", err.Error())) + ac.AnchorError = common.NewGlobalAnchorError(err.Error()) return returnPath, ac.AnchorError.Error() } return "", nil diff --git a/pkg/engine/common/anchorKey.go b/pkg/engine/common/anchorKey.go index 6e1e92e13d..4d52bf0c0d 100644 --- a/pkg/engine/common/anchorKey.go +++ b/pkg/engine/common/anchorKey.go @@ -74,10 +74,10 @@ type ValidateAnchorError struct { } // ConditionalAnchorErrMsg - the error message for conditional anchor error -var ConditionalAnchorErrMsg = "conditionalAnchorError" +var ConditionalAnchorErrMsg = "conditional anchor mismatch" // GlobalAnchorErrMsg - the error message for global anchor error -var GlobalAnchorErrMsg = "globalAnchorError" +var GlobalAnchorErrMsg = "global anchor mismatch" // AnchorKey - contains map of anchors type AnchorKey struct { diff --git a/pkg/kyverno/test/test_command.go b/pkg/kyverno/test/test_command.go index 5b4dade930..352eaa5b46 100644 --- a/pkg/kyverno/test/test_command.go +++ b/pkg/kyverno/test/test_command.go @@ -482,7 +482,7 @@ func printTestResult(resps map[string]report.PolicyReportResult, testResults []T rc.Pass++ } } else { - fmt.Printf("test failed for policy=%s, rule=%s, resource=%s, expected=%s, recieved=%s \n", + fmt.Printf("test failed for policy=%s, rule=%s, resource=%s, expected=%s, received=%s \n", v.Policy, v.Rule, v.Resource, v.Result, testRes.Result) fmt.Printf("%s \n", testRes.Message) res.Result = boldRed.Sprintf("Fail")