You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: lookup-safe access for optional cluster_addons + additional_node_policies (RULE-015) (#350)
Optional spec fields must be read via lookup(var.instance.spec, "field",
default) rather than var.instance.spec.field directly. The Facets exec path
does not reliably apply the optional() defaults declared in variables.tf, so a
blueprint that omits an optional field crashes at plan/apply on the direct
attribute access (RULE-015).
Two crash sites fixed:
1. kubernetes_cluster/eks_standard/1.0/main.tf — cluster_addons is optional
(only cluster_version is required). The locals read
var.instance.spec.cluster_addons and nested .vpc_cni / .kube_proxy /
.coredns directly, so a blueprint omitting cluster_addons crashed. Added a
cluster_addons_spec = lookup(var.instance.spec, "cluster_addons", {}) local
and routed every addon read through nested lookups with defaults. Omitting
cluster_addons now enables all default addons (matching the schema/UI
defaults).
2. karpenter/default/1.0/main.tf — additional_node_policies is optional but was
read directly via values(var.instance.spec.additional_node_policies),
crashing when omitted. Now values(lookup(var.instance.spec,
"additional_node_policies", {})).
Backward-compatible bugfix: behaviour is identical when the fields are present,
and previously-crashing omissions now fall back to documented defaults. No
version bump (RULE-023 reserves bumps for breaking changes).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments