Workload cluster creation errors with capital alphabet in cluster name
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 328
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 9
Description
**What happened**:
Tried to create a workload cluster with name `workload-cluster-A` on an existing management cluster. EKS-A errored out with logs saying invalid value for cluster metadata.name when applying the config on management cluster.
**What you expected to happen**:
Pre-flights validation should catch this before applying on the management cluster or convert cluster name into small cases before applying on the management cluster.
Provider: CloudStack
Logs:
```
2023-02-14T13:08:19.224-0600 V9 docker {"stderr": "Error from server (Invalid): error when creating \"STDIN\": Cluster.cluster.x-k8s.io \"vgg-cloudstack-A\" is invalid: metadata.name: Invalid value: \"vgg-cloudstack-A\": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')\nError from server (Invalid): error when creating \"STDIN\": CloudStackCluster.infrastructure.cluster.x-k8s.io \"vgg-cloudstack-A\" is invalid: metadata.name: Invalid value: \"vgg-cloudstack-A\": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')\nError from server (Invalid): error when creating \"STDIN\": KubeadmControlPlane.controlplane.cluster.x-k8s.io \"vgg-cloudstack-A\" is invalid: metadata.name: Invalid value: \"vgg-cloudstack-A\": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
```
Contributor guide
Research direction
Start by locating the workload cluster creation and pre-flight validation paths, then reproduce the issue with a cluster name containing a capital letter. Trace where the name is applied to management-cluster resources and add a regression test covering the invalid name. Done means the invalid name is rejected before application or is consistently converted to a valid lowercase name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100