-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Ingress annotation validation earlier in k8s lifecycle #1270
Conversation
Minimal validation was performed at the stage when errors can be show to the user in k8s status messages. Most was done later, when errors could only be written to the controller's log file. This change moves some of the validation to the earlier phase, more will follow.
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.
@mikestephen looks good! 👏 I think the new annotation validation framework will successfully validate the rest of the annotations
I left a few comments
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 satisfy golint
before merging?
$ golint internal/configs/parsing_helpers.go
internal/configs/parsing_helpers.go:170:1: exported function ParseInt should have comment or be unexported
internal/configs/parsing_helpers.go:174:1: exported function ParseInt64 should have comment or be unexported
internal/configs/parsing_helpers.go:178:1: exported function ParseUint64 should have comment or be unexported
internal/configs/parsing_helpers.go:207:1: comment on exported const OffsetFmt should be of the form "OffsetFmt ..."
internal/configs/parsing_helpers.go:212:1: exported function ParseOffset should have comment or be unexported
internal/configs/parsing_helpers.go:221:1: comment on exported const SizeFmt should be of the form "SizeFmt ..."
internal/configs/parsing_helpers.go:226:1: exported function ParseSize should have comment or be unexported
internal/configs/parsing_helpers.go:237:1: exported function ParseProxyBuffers should have comment or be unexported
} | ||
|
||
// timeRegexp http://nginx.org/en/docs/syntax.html | ||
var timeRegexp = regexp.MustCompile(`^([0-9]+([ms|s|m|h|d|w|M|y]?){0,1} *)+$`) |
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.
Building the regexp from the slice of time units didn't seem to be worth the effort.
Minimal validation was performed at the stage when errors can be show to the user in k8s
status messages. Most was done later, when errors could only be written to the controller's
log file. This change moves some of the validation to the earlier phase, more will follow.
Proposed changes
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue here in this description (not in the title of the PR).
Checklist
Before creating a PR, run through this checklist and mark each as complete.