Skip to content

Plan fails with node_metadata set to GCE_METADATA or EXPOSE #1542

@fcrespel

Description

@fcrespel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    StalebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions