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

Plan fails with node_metadata set to GCE_METADATA or EXPOSE #1542

Closed
fcrespel opened this issue Jan 24, 2023 · 1 comment
Closed

Plan fails with node_metadata set to GCE_METADATA or EXPOSE #1542

fcrespel opened this issue Jan 24, 2023 · 1 comment
Labels
bug Something isn't working Stale

Comments

@fcrespel
Copy link
Contributor

TL;DR

The node_metadata variable cannot be set to GCE_METADATA or EXPOSE (legacy value) anymore due to a mistake in the backward compatibility mapping introduced in #1129:

old_node_metadata_config_mapping = { GKE_METADATA_SERVER = "GKE_METADATA", GCE_METADATA = "EXPOSE" }

The legacy EXPOSE value should be mapped to the new GCE_METADATA value, but here it's the opposite: the GCE_METADATA value is mapped to EXPOSE, which is no longer valid.

Expected behavior

Plan should apply with node_metadata set to GCE_METADATA or EXPOSE (legacy value).

Observed behavior

Plan fails with the following error in both cases:

expected node_pool.0.node_config.0.workload_metadata_config.0.mode to be one of [MODE_UNSPECIFIED GCE_METADATA GKE_METADATA], got EXPOSE

Terraform Configuration

module "gke" {
  source                   = "terraform-google-modules/kubernetes-engine/google"
  project_id               = var.project_id
  name                     = var.cluster_name
  region                   = var.region
  network                  = var.network
  subnetwork               = var.subnetwork
  ip_range_pods            = var.ip_range_pods
  ip_range_services        = var.ip_range_services
  kubernetes_version       = "1.23"
  node_metadata            = "GCE_METADATA" # This does not work
  remove_default_node_pool = true
  node_pools = [
    {
      name         = "node-pool-01"
      min_count    = 1
      max_count    = 3
      auto_upgrade = true
    }
  ]
}

Terraform Version

Terraform v1.3.7
on windows_amd64

Additional information

No response

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Mar 25, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2023
CPL-markus pushed a commit to WALTER-GROUP/terraform-google-kubernetes-engine that referenced this issue Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

1 participant