rancher/terraform-provider-rke

Client Error: error parsing version(v1.27.11-rancher1-1) as semver: Invalid characters in version

papanito opened this issue · 1 comments

I have the follwing config:

resource "rke_cluster" "rancher_server" {

  cluster_name       = "rancher-management"
  addons             = file("${path.module}/files/addons.yaml")
  kubernetes_version = var.kubernetes_version
  enable_cri_dockerd = true

  services {
    etcd {
      # for etcd snapshots
      backup_config {
        interval_hours = 12
        retention      = 6
      }
    }
  }

When I set var.kubernetes_version = v1.27.11 I get this message

Plan: 0 to add, 1 to change, 3 to destroy.
╷
│ Error: expected kubernetes_version to be one of ["v1.27.11-rancher1-1" "v1.27.10-rancher1-2" ....], got v1.27.11

When I change it to one of the suggested versions var.kubernetes_version = v1.27.11-rancher1-1

│ Error: updating Kubernetes Version for Kubernetes Cluster (Subscription: "4d857ef1-0a25-4248-80f4-04b627235f03"
│ Resource Group Name: "rg-sandbox004-chn-aks"
│ Kubernetes Cluster Name: "aks-rancher-playground-chn"): performing CreateOrUpdate: unexpected status 400 (400 Bad Request) with response: {
│   "code": "BadRequest",
│   "details": null,
│   "message": "Client Error: error parsing version(v1.27.11-rancher1-1) as semver: Invalid characters in version",
│   "subcode": ""
│  }
│
│   with module.aks.azurerm_kubernetes_cluster.aks,
│   on ..\tf_templates\privateAks\aks.tf line 2, in resource "azurerm_kubernetes_cluster" "aks":
│    2: resource "azurerm_kubernetes_cluster" "aks" {

My versions

Terraform v1.7.5
on windows_amd64
+ provider registry.terraform.io/azure/azapi v1.12.1
+ provider registry.terraform.io/carlpett/sops v1.0.0
+ provider registry.terraform.io/gavinbunney/kubectl v1.14.0
+ provider registry.terraform.io/hashicorp/azuread v2.48.0
+ provider registry.terraform.io/hashicorp/azurerm v3.99.0
+ provider registry.terraform.io/hashicorp/helm v2.13.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.29.0
+ provider registry.terraform.io/hashicorp/local v2.5.1
+ provider registry.terraform.io/hashicorp/random v3.6.0
+ provider registry.terraform.io/hashicorp/time v0.11.1
+ provider registry.terraform.io/rancher/rke v1.4.4

I use the variable in 2 places, while the version is actually different. So it's a config error not an issue