-
Notifications
You must be signed in to change notification settings - Fork 52
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
Validate longest pod name for jobset will not exceed 63 chars #409
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danielvegamyhre The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
// Add 5 char suffix to the deterministic part of the pod name to validate the full pod name is compliant. | ||
longestPodName := placement.GenPodName(js.Name, rjob.Name, maxJobIndex, maxPodIndex) + "-abcde" | ||
for _, errMessage := range validation.IsDNS1035Label(longestPodName) { | ||
allErrs = append(allErrs, fmt.Errorf(errMessage)) |
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.
Will the error message contain the -abcde
? If so, I am afraid that will be confusing and perhaps better to have our own error message.
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'll test and confirm really quick
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.
Error message looks good to me:
$ k apply -f examples/simple/test.yaml
Error from server (Forbidden): error when creating "examples/simple/exclusive-placement.yaml": admission webhook "vjobset.kb.io" denied the request: must be no more than 63 characters
/lgtm |
…-#409-upstream-release-0.3 Automated cherry pick of #409: validate longest pod name for jobset will not exceed 63 chars
Fixes #408