cilium-cli icon indicating copy to clipboard operation
cilium-cli copied to clipboard

Transform autodetected cluster name to lowercase

Open dosmanak opened this issue 3 years ago • 2 comments

kubeconfig cluster.name can contain uppercase.

https://github.com/cilium/cilium-cli/blob/e7035487d5b3675c3a6876369a4dbf11b57dba2e/install/autodetect.go#L33 forces it does not.

From the error it is not clear why the clustername must be lowercase and what is the purpose. Since there is some transformation already at https://github.com/cilium/cilium-cli/blob/e7035487d5b3675c3a6876369a4dbf11b57dba2e/install/autodetect.go#L135

Why not add also lowercase transformation?

dosmanak avatar Feb 24 '22 13:02 dosmanak

Maybe also fix the documentation https://github.com/cilium/cilium-cli/blob/master/internal/cli/cmd/install.go#L51 with "Used for clustermesh if enabled" if that is true

dosmanak avatar Feb 24 '22 13:02 dosmanak

For context, the cluster name is used as part for FQDNs names, see also this commit. So our validation is stricter than what is allowed as kubeconfig context name.

kaworu avatar Mar 02 '22 16:03 kaworu

Hi, will this issue be addressed or shall I close it?

dosmanak avatar Feb 14 '23 21:02 dosmanak

hi @dosmanak thanks for the report! as @kaworu mentioned, we intentionally limit the cluster name to be lowercase, so we'd like to keep the current restriction. i'll mark this as wontfix, but please let us know if you have some specific use cases in mind that require the cluster name to be uppercase 🙏

michi-covalent avatar Feb 15 '23 15:02 michi-covalent

Hello. I understand the limit. But since there Is already replacement of _ to - I don't see why the creation should fail. It could instead transform all uppercase letters to lowercase. If already existing cluster contains uppercase, I can't install cilium using cli. It is possible to rename it in Kube config, but it can bring confusion.

dosmanak avatar Feb 15 '23 19:02 dosmanak