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

Use NameGenerator for composite name generation #5062

Merged
merged 1 commit into from Nov 28, 2023

Conversation

pedjak
Copy link
Contributor

@pedjak pedjak commented Nov 27, 2023

Description of your changes

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

Related #4858

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added or updated unit tests.
  • [ ] Added or updated e2e tests.
  • [ ] Linked a PR or a docs tracking issue to document this change.
  • [ ] Added backport release-x.y labels to auto-backport this PR.

Need help with this checklist? See the cheat sheet.

@pedjak pedjak requested review from negz and a team as code owners November 27, 2023 17:51
@pedjak pedjak requested a review from bobh66 November 27, 2023 17:51
// 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.
Copy link
Contributor

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.

internal/names/generate.go Outdated Show resolved Hide resolved
internal/names/generate.go Outdated Show resolved Hide resolved

// 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.
Copy link
Contributor

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.

@sttts
Copy link
Contributor

sttts commented Nov 28, 2023

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>
@pedjak pedjak force-pushed the use-name-generator-for-composites branch from 4ba31ce to 13c2d1f Compare November 28, 2023 15:16
@turkenh turkenh merged commit eeee5cd into crossplane:master Nov 28, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants