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
Use NameGenerator
for composite name generation
#5062
Use NameGenerator
for composite name generation
#5062
Conversation
// then we are going to update an existing composite, | ||
// hijacking it from another claim. Depending on context/environment | ||
// the consequences could be more or less serious. | ||
// TODO: decide if we must prevent it. |
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.
to be clear here: this is the same in the old code, @pedjak just made it clearer here in the comment.
|
||
// GenerateName generates a name using the same algorithm as the API server, and | ||
// verifies temporary name availability. It does not submit the composed | ||
// resource to the API server and hence it does not fall over validation errors. |
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.
same, please adapt. This can be used for anything, no only composed resources.
Some nits. |
The generator is already used for MR name generation. Changes: * since used by two controllers, `NameGenerator` moved under `internal/names` package * `configurator_test.go` updated Signed-off-by: Predrag Knezevic <predrag.knezevic@upbound.io>
4ba31ce
to
13c2d1f
Compare
Description of your changes
The generator is already used for MR name generation.
Changes:
NameGenerator
moved underinternal/names
packageconfigurator_test.go
updatedRelated #4858
I have:
make reviewable
to ensure this PR is ready for review.[ ] Added or updated e2e tests.[ ] Linked a PR or a docs tracking issue to document this change.[ ] Addedbackport release-x.y
labels to auto-backport this PR.Need help with this checklist? See the cheat sheet.