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

Unable to create a cluster in vSphere if the dc name consists of only numbers #3381

Closed
adonskoy opened this issue Sep 17, 2022 · 4 comments
Closed
Labels
ack Issue has been acknowledged external An issue, bug or feature request filed from outside the AWS org
Milestone

Comments

@adonskoy
Copy link
Contributor

What happened:
If the vSphere datacenter name specified in VSphereDatacenterConfig contains only numbers, then during generation of the VSphereMachineTemplate an integer value is substituted in spec.template.spec.datacenter (even if the value is a string in VSphereDatacenterConfig). This results in an error while applying the new resources of this kind.

2022-09-17T12:57:07.798+0300    V6      Executing command       {"cmd": "/usr/local/bin/docker exec -i eksa_1663408305631319000 kubectl apply -f - --namespace eksa-system --kubeconfig eks-system/generated/eks-system.kind.kubeconfig"}
2022-09-17T12:57:08.194+0300    V5      Error happened during retry     {"error": "executing apply: Error from server (Invalid): error when creating \"STDIN\": VSphereMachineTemplate.infrastructure.cluster.x-k8s.io \"eks-system-control-plane-template-1663408479593\" is invalid: spec.template.spec.datacenter: Invalid value: \"integer\": spec.template.spec.datacenter in body must be of type string: \"integer\"\nError from server (Invalid): error when creating \"STDIN\": VSphereMachineTemplate.infrastructure.cluster.x-k8s.io \"eks-system-etcd-template-1663408479593\" is invalid: spec.template.spec.datacenter: Invalid value: \"integer\": spec.template.spec.datacenter in body must be of type string: \"integer\"\nError from server (Invalid): error when creating \"STDIN\": VSphereMachineTemplate.infrastructure.cluster.x-k8s.io \"eks-system-md-0-1663408479597\" is invalid: spec.template.spec.datacenter: Invalid value: \"integer\": spec.template.spec.datacenter in body must be of type string: \"integer\"\n", "retries": 28}

What you expected to happen:
When generating a resource manifest of kind VSphereMachineTemplate, always convert the spec.template.spec.datacenter value to a string.

How to reproduce it (as minimally and precisely as possible):
Name the datacenter in vSphere like 1234 and try to create a new initial-cluster.

Anything else we need to know?:

Environment:

  • EKS Anywhere Release: v0.11.2
  • EKS Distro Release:
@vivek-koppuru vivek-koppuru added ack Issue has been acknowledged external An issue, bug or feature request filed from outside the AWS org labels Sep 19, 2022
@vivek-koppuru vivek-koppuru added this to the oncall milestone Sep 19, 2022
@vivek-koppuru
Copy link
Member

Thank you for raising this issue and also creating a PR! We can communicate more on the PR with your suggestion.

Do you have a datacenter that only consists of numbers? I am curious how this looks in CAPV as it is rejecting it at that level, so will look into that a bit more before commenting on your PR.

@adonskoy
Copy link
Contributor Author

Thank you for raising this issue and also creating a PR! We can communicate more on the PR with your suggestion.

Do you have a datacenter that only consists of numbers? I am curious how this looks in CAPV as it is rejecting it at that level, so will look into that a bit more before commenting on your PR.

It rejects during crd schema validation.

@vivek-koppuru
Copy link
Member

So are you mentioning that it is possible to name a datacenter with all integers?

@vivek-koppuru
Copy link
Member

Closing in favor of #3382 getting merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Issue has been acknowledged external An issue, bug or feature request filed from outside the AWS org
Projects
None yet
Development

No branches or pull requests

2 participants