digitalocean / terraform-provider-digitalocean

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

Point docs to data attribute that actually exists #1201

Closed Mycobee closed 1 month ago

Mycobee commented 1 month ago

This is a simple docs update to call an attribute that actually exists for the kubernetes cluster version

Mycobee commented 1 month ago

@danaelhe may I get a review on this please?

Mycobee commented 1 month ago

actually lets not do that. I think there are things under the hood that happen with latest_version that I misunderstood. I realize now that the original thing worked SMH

cc @danaelhe

Mycobee commented 1 month ago

for some reason, after testing...this code is perfectly valid

data "digitalocean_kubernetes_versions" "current" {
  version_prefix = var.cluster_version
}

resource "digitalocean_kubernetes_cluster" "primary" {
  name    = var.cluster_name
  region  = var.cluster_region
  version = data.digitalocean_kubernetes_versions.current.latest_version

  node_pool {
    name       = "default"
    size       = var.worker_size
    node_count = var.worker_count
  }
}
Mycobee commented 1 month ago

I suspect latest_version somehow gets the minor patch and adds it on to the version_prefix. Regardless, it works

danaelhe commented 1 month ago

Ah I see. I’ll take a closer look on Tuesday and will reopen if necessary