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

Sanitize the autodetected cluster name #2591

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

giorio94
Copy link
Member

@giorio94 giorio94 commented Jun 11, 2024

Replace underscores and dots with dashes, as they are not allowed characters for cluster names.

Additionally perform the same validation already implemented by the latest Cilium version, to exit early and provide a helpful message in case of errors.

Edit. I've removed these changes as bumping the Cilium dependency seems to cause a couple of tests to fail quite consistently.

(The large diff count is caused by bumping the Cilium dependency to the current main, to reuse the already available validation function. Please review commit by commit)

@giorio94 giorio94 force-pushed the pr/giorio94/main/cluster-name-validation branch from 36f43d2 to cd2369f Compare June 11, 2024 16:34
@giorio94 giorio94 force-pushed the pr/giorio94/main/cluster-name-validation branch from cb3e912 to c5eccc3 Compare June 12, 2024 07:08
@giorio94 giorio94 marked this pull request as ready for review June 12, 2024 07:09
@giorio94 giorio94 requested review from a team as code owners June 12, 2024 07:09
@giorio94 giorio94 changed the title Sanitize and validate the configured cluster name Sanitize and validate the configured/detected cluster name Jun 12, 2024
Copy link
Member

@sayboras sayboras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note that cluster name in kubeconfig can be manipulated anytime, but I guess it's ok as part of installation.

Copy link
Contributor

@viktor-kurchenko viktor-kurchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giorio94 LGTM

@giorio94
Copy link
Member Author

Let me try dropping the commit which bumps the cilium dependency, to see if the CI failures resolve (as they cannot be possibly caused by the other changes). That also leads to dropping the extra validation, which I'll add back in a separate PR.

@giorio94 giorio94 changed the title Sanitize and validate the configured/detected cluster name Sanitize the autodetected cluster name Jun 13, 2024
Instead of using the cluster name parameter, which could be different on
upgrade (e.g., if the user previously specified a different name), or
mutated in case it does not match the expected format.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Replace underscores and dots with dashes, as they are not allowed
characters for cluster names.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
Dots are not allowed as part of the cluster name. Let's fix the kind
workflow to only configure valid cluster names.

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
@giorio94
Copy link
Member Author

@doniacld Gentle ping 🙏

@giorio94
Copy link
Member Author

@doniacld Gentle ping 🙏

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 25, 2024
@michi-covalent michi-covalent merged commit 9658f02 into main Jun 25, 2024
14 of 15 checks passed
@michi-covalent michi-covalent deleted the pr/giorio94/main/cluster-name-validation branch June 25, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants