Skip to content

node_pools_cgroup_mode var does not correctly handle the "all" map key #2196

@bboerst

Description

@bboerst

TL;DR

For module users who want to pin the CGROUP version using the new node_pools_cgroup_mode feature released in #2001, specifying an "all" key does not correctly apply the value to all node-pools like expected.

Some examples...

This does not apply the change to any node pools.

node_pools_cgroup_mode = {
  all = "CGROUP_MODE_V2"
}

...but specifying the individual node pool names does work:

node_pools_cgroup_mode = {
  default-pool = "CGROUP_MODE_V2"
  ondemand = "CGROUP_MODE_V2"
  spot = "CGROUP_MODE_V2"
}

I believe that the logic for handling all is missing from here:

cgroup_mode = local.node_pools_cgroup_mode[each.value["name"]] == "" ? null : local.node_pools_cgroup_mode[each.value["name"]]

Expected behavior

The all key is nice for users who want to pin the CGROUP version for all node-pools without needing to specify each individual node-pool.

The default variable does include an all key, so I believe that the intention is to have this working:

default = {
all = ""
default-node-pool = ""
}

Observed behavior

When specifying all for node_pools_cgroup_mode, no changes are made to the cluster configuration. When each individual node-pool is specified, then changes are made correctly.

Terraform Configuration

node_pools_cgroup_mode = {
  all = "CGROUP_MODE_V2"
}

Terraform Version

1.9.8

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions