rancher / terraform-provider-rancher2

Terraform Rancher2 provider
https://www.terraform.io/docs/providers/rancher2/
Mozilla Public License 2.0
253 stars 219 forks source link

[RFE] Validate kubernetes_version #1255

Open felipe-colussi opened 8 months ago

felipe-colussi commented 8 months ago

Is your feature request related to a problem? Please describe.

Wile creating a rancher2_cluster_v2 or rancher2_cluster the kubernetes_version is not validated, and if one that is not right is passed rancher will get stuck wile creating the cluster.

Describe the solution you'd like

Create a validator, avoiding users to pass a wrong k8s version, as it works on the rke provider.

Describe alternatives you've considered

Maybe just create a base regexp to ensure that a version that is obviously wrong don't get accepted.

Additional context

SURE-7010

Tejeev commented 8 months ago

It's worth noting that users are most likely to encounter this issue and least likely to find what they did wrong because they put in something like a 3 instead of a 2. Can we not have a check that actually compares to the releases in the repo or releasetags, or something?

felipe-colussi commented 8 months ago

For RKE1 we do have a list of releases in the project. For RKE2 and K3S we have no obvious way of doing so. It would require further investigation.