-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve logging message #1232
Improve logging message #1232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see question - I am unsure of what the message is used for....
@@ -235,7 +235,7 @@ func MatchesResourceDescription(resourceRef unstructured.Unstructured, ruleRef k | |||
} | |||
|
|||
// creating final error | |||
var errorMessage = "rule not matched:" | |||
var errorMessage = fmt.Sprintf("rule %s not matched:", ruleRef.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "rule <%s> was not matched" mean?
Is this indicating that the admission request / resource did not match the rule, or that the rule resulted in an a policy failure (i.e. violation).
I think its the latter, in which case the message is misleading.
The message could be, "rule %s result = fail" or "rule %s failed".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually the former, this function MatchesResourceDescription
evaluates if the given resource matches the rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then it seems fine. Thanks!
Fixes #1192.
Fixes #1224.
Fixes #1225.