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

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

Open
bboerst opened this issue Nov 26, 2024 · 1 comment · May be fixed by #2224
Open

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

bboerst opened this issue Nov 26, 2024 · 1 comment · May be fixed by #2224
Labels
bug Something isn't working

Comments

@bboerst
Copy link

bboerst commented Nov 26, 2024

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

@bboerst bboerst added the bug Something isn't working label Nov 26, 2024
@DrFaust92
Copy link
Contributor

Ill open a PR, I think I see the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants