Repository navigation
[release-0.20] Drop a trailing dot when truncating generated object names - #18959
Conversation
…ames Backport of the main-branch fix to release-0.20. Workload, ProvisioningRequest, ProvisioningRequest PodTemplate and virtual Pod 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 all three name sanitizers. A trailing '-' is kept: "--" is valid, and trimming it would change the names of existing objects. Conflicts resolved: the import blocks of pkg/cache/scheduler/was/virtual_pods.go and virtual_pods_test.go differ on release-0.20 (pkg/util/podset, k8s.io/utils/ptr); kept them and added only the utilstrings and validation imports. 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: d91b36f4ef1fe97e52aa999439b37d1061114dc0 |
|
[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 |
80f31e6
into
kubernetes-sigs:release-0.20
|
/set-release-note |
|
✅ The release note was updated to: |
Cherry pick of #18803 on release-0.20.
#18803: Drop a trailing dot when truncating generated object names
For details on the cherry pick process, see the cherry pick requests page.
The cherry-pick robot failed on the import blocks of
pkg/cache/scheduler/was/virtual_pods.goandvirtual_pods_test.go, which differ on release-0.20 (pkg/util/podset,k8s.io/utils/ptr). I kept the branch's imports and added onlyutilstringsandvalidation. The rest of the change applies unchanged.What type of PR is this?
/kind bug
Useful notes for your reviewer
go build ./...,go vetandgo testpass forpkg/util/strings,pkg/controller/jobframework,pkg/controller/admissionchecks/provisioningandpkg/cache/scheduler/was. With release-0.20's originalworkload_names.go,controller.goandvirtual_pods.go, the 5 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.