rancher / terraform-provider-rancher2

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

[BUG] 422 Error when Updating Labels #1294

Open miles-ctc opened 8 months ago

miles-ctc commented 8 months ago

Rancher Server Setup

Information about the Cluster

goldyfruit commented 1 month ago

Same behavior here.

resource "rancher2_cluster" "gke-cluster" {
  name        = var.google_gke_cluster_name
  description = "GKE cluster imported via Terraform"
  gke_config_v2 {
    name                     = var.google_gke_cluster_name
    google_credential_secret = rancher2_cloud_credential.gke-credential.id
    region                   = var.google_gke_region
    project_id               = var.google_project_id
    imported                 = true
  }
  labels = {
    "importedBy" : "terraform"
    "environment" : "dev"
  }
}

Error returned:

│ Error: Bad response statusCode [422]. Status [422 Unprocessable Entity]. Body: [baseType=error, code=InvalidBodyContent, message=must have at least one node pool] from [https://rancher.xx.xx/v3/clusters/c-vjj58]
│ 
│   with rancher2_cluster.gke-cluster,
│   on main.tf line 29, in resource "rancher2_cluster" "gke-cluster":
│   29: resource "rancher2_cluster" "gke-cluster" {