digitalocean / terraform-provider-digitalocean

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

Point docs to data attribute that actually exists #1201

Closed Mycobee closed 2 months ago

Mycobee commented 2 months ago

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

Mycobee commented 2 months ago

@danaelhe may I get a review on this please?

Mycobee commented 2 months 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 2 months 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 2 months ago

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

danaelhe commented 2 months ago

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