-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Annotations: Log validation error. #13093
base: main
Are you sure you want to change the base?
Conversation
Otherwise operators will have to read the source code, to see what characters are allowed and what aren't.
The committers listed above are authorized under a signed CLA. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gnarlex The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @gnarlex! |
Hi @gnarlex. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
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.
Can you please add examples how the result looks like? Also I'd not consider this a fix as your change is not making the code work as it was expected to work, but rather improves debugging - so is an improvement. Anyway...
/retitle Annotations: Log validation error.
/triage accepted
/kind feature
/priority backlog
/hold
@@ -240,7 +240,7 @@ func checkAnnotation(name string, ing *networking.Ingress, fields AnnotationFiel | |||
// We don't run validation against empty values | |||
if EnableAnnotationValidation && annotationValue != "" { | |||
if err := validateFunc(annotationValue); err != nil { | |||
klog.Warningf("validation error on ingress %s/%s: annotation %s contains invalid value %s", ing.GetNamespace(), ing.GetName(), name, annotationValue) | |||
klog.Warningf("validation error on ingress %s/%s: annotation %s contains invalid value %s. err: %s", ing.GetNamespace(), ing.GetName(), name, annotationValue, err) |
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.
klog.Warningf("validation error on ingress %s/%s: annotation %s contains invalid value %s. err: %s", ing.GetNamespace(), ing.GetName(), name, annotationValue, err) | |
klog.Warningf("validation error on ingress %s/%s: annotation %s contains invalid value %s: %s", ing.GetNamespace(), ing.GetName(), name, annotationValue, err) |
@gnarlex Any update here? Can you maybe respond to my questions so we can get this merged? Thank you! |
What this PR does / why we need it:
When an annotations is validated, it only prints that the given value is invalid, but not why it's invalid.
This makes it harder for operators to fix issues, as they have to read the source code, to see which characters are allowed and which aren't.
Types of changes
How Has This Been Tested?
Verified manually.
Checklist: