Skip to content

grid-site chart: minimal install (only required name fields) fails with "spec: Required value" #49

Description

@jordigilh

Summary

A minimal grid-site chart install — using only the two fields required by
values.schema.json (gridNetwork.name, gridSite.name) and leaving every
other gridNetwork.* value at its chart default — is rejected by the
Kubernetes API server:

The GridNetwork "prod-grid" is invalid: spec: Required value

This reproduces identically on main (confirmed via
git archive origin/main -- charts/grid-site rendered against a live Kind
cluster with kubectl create --dry-run=server), so it is not specific to
any in-flight feature branch.

Root cause

charts/grid-site/templates/gridnetwork.yaml gates every single
GridNetwork.spec field behind a Helm {{- with ... }} block:
gridId, region, zone, routingPolicy, scoringPolicy,
metricsRefreshInterval, swim, tls, gatewayRefs. The chart's
values.yaml defaults for all of these are falsy ("", {}, or []), which
Go's text/template with treats as "absent" — so when none of them are
overridden, the rendered spec: has no children at all:

spec:

That's YAML null, not an empty object ({}). The GridNetwork CRD's
structural schema requires spec to be present as an object, so the API
server rejects both a fresh helm install and any helm upgrade that lands
on this all-defaults state (e.g. removing the last non-default field, such as
budgetPolicy, from an existing release).

Impact

Any consumer following the chart's own documented minimal usage (set only the
two required name fields) cannot install grid-site today. This was caught
while live-validating grid#47 (tenant-budget plumbing) on a Kind cluster on
helios08 — unsetting budgetPolicy via helm upgrade was the reproduction
path, but the bug pre-dates that PR and affects any all-defaults install.

Fix

Fixed alongside grid#47: gridId is now rendered unconditionally
(gridId: {{ .Values.gridNetwork.gridId | quote }}, defaulting to "",
which is already a valid/expected value per the CRD's own server-side
default) instead of being gated behind with. This guarantees spec always
has at least one key, so it's never null. A helm-unittest regression case
("renders a non-null spec when only the required name fields are set") was
added to charts/grid-site/tests/gridnetwork_test.yaml.

Verified live on a Kind cluster (helios08):

  • Before fix: kubectl create --dry-run=server on the minimal-fields render → spec: Required value.
  • After fix: same dry-run → gridnetwork.grid.praxis-proxy.io/zz-fresh created (server dry run).
  • helm upgrade removing budgetPolicy from an existing release (previously failed with the same error) now succeeds and status.budgetStatus clears back to empty as expected.
  • Full KIND=1 ./scripts/verify-helm-chart.sh (182 checks) still passes with no regressions.

See #47 for the fix commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions