-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Loosen label and annotation validation and related tests #4898
Conversation
} | ||
totalSize += (int64)(len(k)) + (int64)(len(v)) | ||
} | ||
if totalSize > (int64)(util.TotalAnnotationSizeB) { |
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.
The total allowed annotation size is an attribute of the API, not an attribute of util. I'm trying to keep the util.* plausibly generic - not kubernetes policy in there. This const should move to this file.
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.
Moved to validation.go
fa5e5f8
to
15f6d1f
Compare
Friendly ping |
return true | ||
} | ||
|
||
const kubeToken string = "[A-Za-z0-9]" |
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.
just nits:
"token" implies a word, but this is a char.
Suggest "qualNameChar" for what you call kubeToken, "qualNameInnerChar" for extendedKubeToken
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.
I figured out that we can be even move general, as those definitions will be used for label value format as well. I went with kubeChar and extendedKubeChar.
const extendedKubeChar string = "[-A-Za-z0-9_.]" | ||
const qualifiedToken string = "(" + kubeChar + extendedKubeChar + "*)?" + kubeChar | ||
|
||
const LabelValueFmt string = "((" + kubeChar + extendedKubeChar + "*)?" + kubeChar + ")?" |
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.
Why not define this as "(" + qualifiedToken + ")?" - is that offensive to the purist in you?
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.
Nope:)
I'm going to merge this - my last comments are nits and can be done in a followup. |
Loosen label and annotation validation and related tests
No description provided.