digitalocean / terraform-provider-digitalocean

Terraform DigitalOcean provider
https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs
Mozilla Public License 2.0
503 stars 270 forks source link

Upgrading cluster to new patch version does nothing #887

Open juicemia opened 1 year ago

juicemia commented 1 year ago

Bug Report


Describe the bug

When changing the Kubernetes version from 1.21.9-do.0 to 1.22.13-do.0, Terraform generates the following plan:

  # module.kubernetes_cluster[0].digitalocean_kubernetes_cluster.app will be updated in-place
  ~ resource "digitalocean_kubernetes_cluster" "app" {
        id             = "ce51ac35-9dd4-4a35-88c5-45581ada98f5"
        name           = "app-prod"
        tags           = []
      ~ version        = "1.21.9-do.0" -> "1.22.13-do.0"
        # (14 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

After successful apply, checking the Kubernetes version using doctl shows that the version is still 1.21.9-do.0, and running terraform plan again generates the same plan as before.

Affected Resource(s)

Expected Behavior

Kubernetes cluster should be on version 1.22.13-do.0.

Actual Behavior

Kubernetes cluster stayed on version 1.21.9-do.0.

Steps to Reproduce

  1. terraform plan after changing the version of the Kubernetes cluster in Terraform.
  2. terraform apply
  3. Check cluster using DO, try creating a plan again.

Terraform Configuration Files

resource "digitalocean_kubernetes_cluster" "app" {
  name     = var.name
  region   = var.region
  version  = "1.22.13-do.0"
  vpc_uuid = var.vpc_id

  node_pool {
    name       = "primary"
    size       = "s-1vcpu-2gb"
    node_count = var.node_count
  }
}

Terraform version

terraform -v
Terraform v1.2.5
on darwin_arm64
+ provider registry.terraform.io/digitalocean/digitalocean v2.17.1
+ provider registry.terraform.io/hashicorp/aws v4.4.0
juicemia commented 1 year ago

Just to debug some more I went through the manual upgrade process up until I got the cluster to version 1.23.10-do.0. I then bumped the version in the Terraform to version 1.24.4-do.0 which is the latest available version and I got the same behavior. terraform apply applies the plan to bump the cluster version. Nothing happens. Subsequent terraform plan creates the same plan as before.