Skip to content
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

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

danielvegamyhre
Copy link
Contributor

Fixes #408

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 13, 2024
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2024
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 13, 2024
// 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))
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

@danielvegamyhre danielvegamyhre Feb 13, 2024

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

@ahg-g
Copy link
Contributor

ahg-g commented Feb 13, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 13, 2024
@k8s-ci-robot k8s-ci-robot merged commit d985000 into kubernetes-sigs:main Feb 13, 2024
9 checks passed
k8s-ci-robot added a commit that referenced this pull request Feb 13, 2024
…-#409-upstream-release-0.3

Automated cherry pick of #409: validate longest pod name for jobset will not exceed 63 chars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate longest generated pod name will not exceed 63 characters
3 participants