Repository navigation
[release-0.19] Drop a trailing dot when truncating generated object names - #18960
Conversation
…ames Backport of the main-branch fix to release-0.19. Workload, ProvisioningRequest and ProvisioningRequest PodTemplate names are built by truncating a prefix and appending "-<hash>". When the cut ends on a '.', the result contains ".-", which is not a valid DNS subdomain, so the API server rejects the Workload or ProvisioningRequest. Add utilstrings.TruncateNamePrefix, which truncates and then trims any trailing '.', and use it in both name sanitizers. A trailing '-' is kept: "--" is valid, and trimming it would change the names of existing objects. Conflicts resolved: pkg/cache/scheduler/was/virtual_pods.go does not exist on release-0.19, so the virtualPodName change and its test are dropped. The provisioning test keeps the release branch's metav1 import, and TestJoinMap (JoinMap is not on release-0.19) is not added to pkg/util/strings/strings_test.go. Signed-off-by: burrows99 <raunakburrows@gmail.com> (cherry picked from commit fdf58b8)
👷 Deploy request for kubernetes-sigs-kueue pending review.Visit the deploys page to approve it
|
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured.: 3
Please check the settings in the CodeRabbit UI or the
|
|
Hi @burrows99. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/ok-to-test |
|
/lgtm |
|
LGTM label has been added. DetailsGit tree hash: 9c3724bddd21d70adbce3c4fd1d6e0455cd78d51 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: burrows99, mimowo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9813daa
into
kubernetes-sigs:release-0.19
|
/set-release-note |
|
✅ The release note was updated to: |
Cherry pick of #18803 on release-0.19.
#18803: Drop a trailing dot when truncating generated object names
For details on the cherry pick process, see the cherry pick requests page.
pkg/cache/scheduler/was/virtual_pods.gois not on release-0.19, so this PR leaves out thevirtualPodNamechange and its test. The Workload and ProvisioningRequest name fixes apply unchanged. The two test-file conflicts are resolved as follows:metav1import.pkg/util/strings/strings_test.gogetsTestTruncateNamePrefixonly.TestJoinMapcame from main's context, andJoinMapis not on this branch.What type of PR is this?
/kind bug
Useful notes for your reviewer
go build ./...,go vetandgo testpass forpkg/util/strings,pkg/controller/jobframeworkandpkg/controller/admissionchecks/provisioning. With release-0.19's originalworkload_names.goandcontroller.go, the 4 new "truncated at a dot" cases fail. With this PR, they pass.AI tools (Claude Code) assisted with this backport; the conflicts were resolved and the tests run as described above.