Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GKE: min_master_version is empty #2348

Closed
paolomainardi opened this issue Oct 29, 2018 · 5 comments
Closed

GKE: min_master_version is empty #2348

paolomainardi opened this issue Oct 29, 2018 · 5 comments

Comments

@paolomainardi
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.

Terraform Version

terraform --version
Terraform v0.11.10
+ provider.google v1.19.1

Affected Resource(s)

  • google_container_cluster

Terraform Configuration Files

variable "k8s_version" {
  default = "1.10.7-gke.6"
}

resource "google_container_cluster" "primary" {
  name               = "gke-cluster"
  description        = ""
  zone               = "europe-west1-b"
  enable_legacy_abac = false
  min_master_version = "${var.k8s_version}"

  master_auth {
    username = "admin"
    password = "admin"
  }

  maintenance_policy {
    daily_maintenance_window {
      start_time = "03:00"
    }
  }

  addons_config {
    kubernetes_dashboard {
      disabled = true
    }
  }
}

Debug Output

Terraform will perform the following actions:

  ~ google_container_cluster.primary
      min_master_version: "" => "1.10.7-gke.6"

  ~ google_container_node_pool.default-pool
      version:            "1.10.7-gke.2" => "1.10.7-gke.6"

  ~ google_container_node_pool.default-pool-n4
      version:            "1.10.7-gke.2" => "1.10.7-gke.6"

  ~ google_container_node_pool.gitlab-ci-build-preemptible
      version:            "1.10.7-gke.2" => "1.10.7-gke.6"

Expected Behavior

The min_master_version should not be empty as it is already on 1.10.7-gke.6

Actual Behavior

The min_master_version is showed as empty.

Steps to Reproduce

  1. Create the cluster manually
  2. Import the cluster with terraform import
@ghost ghost added the bug label Oct 29, 2018
@danawillow
Copy link
Contributor

Hey @paolomainardi, I'm going to go ahead and mark this as blocked by upstream terraform.

When a resource is imported, the code only has access to the id that it was imported with and not any information that was in the config. This means that at import time, we can't see the min_master_version that you set in your config. And although we could potentially set it based on the version upstream, we would have to do that in the read function (which isn't import specific), which would defeat the purpose of the field in the first place (see #577)

@paolomainardi
Copy link
Author

Ok thanks a lot for the explanation @danawillow
My only concern now is what will happen at the next run, because the master is already on "1.10.7-gke.6" version.

@danawillow
Copy link
Contributor

From just looking at the code, I don't think anything will happen. If you want to be extra sure though, you could spin up a small test cluster and import it and see what happens on the next run.

@rileykarson
Copy link
Collaborator

This is reconciled to the best of the provider's current ability by documenting the behaviour at https://www.terraform.io/docs/providers/google/r/container_cluster.html#min_master_version-1.

@ghost
Copy link

ghost commented Jul 15, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 15, 2019
@github-actions github-actions bot added service/container forward/review In review; remove label to forward labels Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants