Skip to content

fix(curator): make the prod resource sizing branch reachable - #78

Open
austinderrick wants to merge 1 commit into
mainfrom
fix/prod-resource-sizing
Open

fix(curator): make the prod resource sizing branch reachable#78
austinderrick wants to merge 1 commit into
mainfrom
fix/prod-resource-sizing

Conversation

@austinderrick

Copy link
Copy Markdown
Contributor

The bug

curator.resources in _helpers.tpl picks a sizing block by environment when a release doesn't set resources itself:

{{- if eq .Values.environment "production" -}}

But values.schema.json restricts environment to dev | qa | prod, and the schema is enforced at render. "production" is a value the chart will not accept, so the production branch was unreachable — a prod release with no explicit resources silently got the small block (500m/512Mi requests and limits) instead of the intended 1 CPU / 1Gi requests and 1500m / 2Gi limits.

Blast radius: none today

All 19 prod-*-helmrelease.yaml files in iac-interworks (plus the .templates/ stub they're generated from) set resources explicitly, so every prod site today takes the override branch and never reaches this code. The fix corrects a latent default: it changes what a future prod site gets if it omits resources, and nothing about the current fleet.

The fix

  • Compare against "prod", the value the schema actually permits.
  • Note on the helper that the compared values have to stay in sync with the schema's environment enum, since that drift is what caused this.
  • Add three cases to deployment_test.yaml: prod sizing, non-prod sizing, and an explicit resources override winning over both.

Testing

Ran the suite locally with the pinned helm 4.2.3 and helm-unittest v1.1.1:

  • With the fix: 25 tests pass across all 6 suites.
  • With the bug reintroduced (reverting only the comparison): the new prod-sizing case fails as it should — Expected to equal: 1 / Actual: 500m.

Found while writing REVIEW.md in #77, which cites this as the reference example of schema/template drift.

curator.resources compared environment to "production", but
values.schema.json restricts environment to dev, qa, or prod, so the
comparison could never be true and a prod release with no explicit
resources fell through to the 500m/512Mi block.

Compare against "prod" and add deployment tests pinning both sizing
branches plus the override path, so the schema enum and the template
can't drift apart again unnoticed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant