-
Notifications
You must be signed in to change notification settings - Fork 277
Description
If you find a similar existing issue, please comment on that issue instead of creating a new one.
If you are submitting a feature request, please start a discussion instead of creating an issue.
Describe the bug
I tried following the instructions on https://docs.cloud.google.com/ai-hypercomputer/docs/create/gke-ai-hypercompute
I cloned cluster-toolkit and built it locally. I got 3 separate errors in modules.
scheduler/gke-cluster
Error: Invalid function argument
on modules/embedded/modules/scheduler/gke-cluster/variables.tf line 120, in variable "maintenance_exclusions":
120: (x.end_time == null || length(trimspace(x.end_time)) > 0)
├────────────────
│ x.end_time is null
This is due to this condition in the for loop not being interpreted as you would suspect (hcl doesn't short-circuit based on conditional values).
for x in var.maintenance_exclusions : (
((x.end_time != null) != (x.exclusion_end_time_behavior != null)) &&
(x.end_time == null || length(trimspace(x.end_time)) > 0)
)
file-system/cloud-storage-bucket
Error: Attempt to get attribute from null value
on modules/embedded/modules/file-system/cloud-storage-bucket/main.tf line 122, in resource "google_storage_bucket" "bucket":
122: for zone in var.anywhere_cache.zones : startswith(zone, var.region)
├────────────────
│ var.anywhere_cache is null
This value is null, so it does not have any attributes.
This fails due to a similar bug, the condition not being short circuited:
condition = var.anywhere_cache == null || alltrue([
for zone in try(var.anywhere_cache.zones, []) : startswith(zone, var.region)
])
management/kubectl-apply/kubectl
Error: Error in function call
on modules/embedded/modules/management/kubectl-apply/kubectl/main.tf line 50, in locals:
50: can(yamldecode(content)) && length(yamldecode(content)) > 0 ? content : null
Call to function "yamldecode" failed: on line 1, column 1: missing start of
document.
This also happens due to lack of short-circuiting.
Steps to reproduce
Steps to reproduce the behavior:
- Clone the repo
- make
- Edit examples/gke-a4/gke-a4-deployment.yaml to set some values
- ./gcluster deploy -d examples/gke-a4/gke-a4-deployment.yaml examples/gke-a4/gke-a4.yaml
Expected behavior
The deployment dir is created with the tf files
Actual behavior
Getting error messages.
Version (gcluster --version)
gcluster version - not built from official release
Built from 'main' branch.
Commit info: v1.76.0-1-ge6ac71d54-dirty
Terraform version: 1.9.8
Execution environment
- OS: macOS
- Shell: zsh
- go version: go1.25.5 darwin/arm64