🐛 fakeclient: retry GenerateName on AlreadyExists collisions#3498
Conversation
|
|
|
Welcome @vieux! |
|
Hi @vieux. 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. |
|
@vieux please sign the CLA so we can accept the contribution |
|
@alvaroaleman 👍 I'm on it, waiting for my employer to approve |
|
@alvaroaleman cla is signed 👍 |
33bca1a to
8a3b20a
Compare
| var createErr error | ||
| for range maxRetries { | ||
| if usingGenerateName { | ||
| base := accessor.GetGenerateName() |
There was a problem hiding this comment.
This is still wrong, it will include the suffix on the second attempt. You need to store it outside the loop
There was a problem hiding this comment.
the suffix is added below on the set name and base is recreated, so I don't think it would include the suffix on the second attempt, but I agree, no need to get the full value + trim each time since it never changes.
There was a problem hiding this comment.
Please leave it up to the author of a comment to decide when to resolve it, as resolving comments hides them
There was a problem hiding this comment.
@alvaroaleman noted, will do next time 👍
8a3b20a to
d76850e
Compare
… 1.32 behavior) The real API server retries GenerateName collisions up to 7 times (RetryGenerateName feature gate, GA in K8s 1.32). The fake client now does the same, preventing flaky tests caused by birthday-paradox collisions when many objects share the same GenerateName prefix. Signed-off-by: Victor Vieux <vieux@repl.it>
d76850e to
80bc294
Compare
|
/retitle 🐛 fakeclient: retry GenerateName on AlreadyExists collisions |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, vieux 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 |
|
LGTM label has been added. DetailsGit tree hash: 866e8db2b28ed29c406c46d9399ae3c5f4795c8a |
The real API server retries GenerateName collisions up to 7 times (RetryGenerateName feature gate, GA in K8s 1.32). The fake client now does the same, preventing flaky tests caused by birthday-paradox collisions when many objects share the same GenerateName prefix.
Closes #3497