rancher / terraform-provider-rke

Terraform provider plugin for deploy kubernetes cluster by RKE(Rancher Kubernetes Engine)
Mozilla Public License 2.0
340 stars 152 forks source link

Provider rising an error with kubernetes_version (different version) + system_images #234

Open Sphinxgaia opened 4 years ago

Sphinxgaia commented 4 years ago

Hello,

Terraform rises an en error when put a non supported Kubernetes version in provider even if we set system_images.

With RKE bin, we can set an specific version, if block system_images sets.

Error ` Error: expected kubernetes_version to be one of [v1.18.3-rancher2-2 v1.18.3-rancher2-1 v1.17.6-rancher2-2 v1.17.6-rancher2-1 v1.17.5-rancher1-1 v1.17.4-rancher1-2 v1.17.4-rancher1-1 v1.17.3-rancher1-1 v1.17.2-rancher1-2 v1.17.2-rancher1-1 v1.17.0-rancher1-2 v1.17.0-rancher1-1 v1.16.10-rancher2-2 v1.16.10-rancher2-1 v1.16.9-rancher1-1 v1.16.8-rancher1-2 v1.16.8-rancher1-1 v1.16.7-rancher1-1 v1.16.6-rancher1-2 v1.16.6-rancher1-1 v1.16.4-rancher1-1 v1.16.3-rancher1-1 v1.16.2-rancher2-1 v1.16.2-rancher1-1 v1.16.1-rancher1-1 v1.15.12-rancher2-3 v1.15.12-rancher2-2 v1.15.12-rancher1-1 v1.15.11-rancher1-3 v1.15.11-rancher1-2 v1.15.11-rancher1-1 v1.15.11-rancher1-0 v1.15.10-rancher1-1 v1.15.9-rancher1-1 v1.15.7-rancher1-1 v1.15.6-rancher1-2 v1.15.5-rancher2-2 v1.15.5-rancher1-2 v1.15.5-rancher1-1 v1.15.4-rancher1-2 v1.15.4-rancher1-1 v1.15.3-rancher1-1 v1.15.2-rancher1-1 v1.15.0-rancher1-1 v1.14.10-rancher1-1 v1.14.10-rancher1-0 v1.14.9-rancher1-2 v1.14.9-rancher1-1 v1.14.8-rancher2-1 v1.14.8-rancher1-1 v1.14.7-rancher1-1 v1.14.6-rancher1-1 v1.14.5-rancher1-1 v1.14.3-rancher1-1 v1.14.1-rancher1-2 v1.14.1-rancher1-1 v1.13.12-rancher2-1 v1.13.12-rancher1-1 v1.13.11-rancher1-1 v1.13.10-rancher1-2 v1.13.10-rancher1-1 v1.13.9-rancher1-2 v1.13.9-rancher1-1 v1.13.7-rancher1-1 v1.13.5-rancher1-3 v1.13.5-rancher1-2 v1.13.5-rancher1-1 v1.13.4-rancher1-2 v1.13.4-rancher1-1 v1.13.1-rancher1-2 v1.13.1-rancher1-1 v1.12.10-rancher1-2 v1.12.10-rancher1-1 v1.12.9-rancher1-1 v1.12.7-rancher1-4 v1.12.7-rancher1-3 v1.12.7-rancher1-2 v1.12.7-rancher1-1 v1.12.6-rancher1-2 v1.12.6-rancher1-1 v1.12.5-rancher1-2 v1.12.5-rancher1-1 v1.12.4-rancher1-1 v1.12.3-rancher1-1 v1.12.1-rancher1-1 v1.12.0-rancher1-1 v1.11.9-rancher1-3 v1.11.9-rancher1-2 v1.11.9-rancher1-1 v1.11.8-rancher1-1 v1.11.6-rancher1-1 v1.11.5-rancher1-1 v1.11.3-rancher1-1 v1.11.2-rancher1-2 v1.11.2-rancher1-1 v1.11.1-rancher1-1 v1.10.12-rancher1-1 v1.10.11-rancher1-1 v1.10.5-rancher1-2 v1.10.5-rancher1-1 v1.10.3-rancher2-1 v1.10.1-rancher2-1 v1.10.0-rancher1-1 v1.9.7-rancher2-2 v1.9.7-rancher2-1 v1.9.5-rancher1-1 v1.8.11-rancher2-1], got v1.16.13-rancher1-1

on .terraform/modules/myrkecluster/main.tf line 160, in resource "rke_cluster" "cluster" `

Terraform v0.12.25

rawmind0 commented 4 years ago

Hi @Sphinxgaia ,

yes, the provider now is validating kubernetes_version to any of the supported values by rke. Anyway, system_images should overwrite container images used by the rke cluster. Have you tried letting kubernetes_version empty and overwriting system_images??

Sphinxgaia commented 4 years ago

Hi @rawmind0,

Sorry for late response. I don't remember, but I think yes. I try empty kubernetes_version with system_images.

I will try asap, with newer version of provider and make a matrix tests table.