Skip to content

fix(chart): correct values.schema.json structure and types - #447

Merged
oribon merged 1 commit into
metallb:mainfrom
lexfrei:fix/values-schema-typos
Jun 23, 2026
Merged

oribon merged 1 commit into
metallb:mainfrom
lexfrei:fix/values-schema-typos

Conversation

@lexfrei

@lexfrei lexfrei commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Is this a BUG FIX or a FEATURE ?:

/kind bug

What this PR does / why we need it:

Four independent bugs in charts/frr-k8s/values.schema.json that together leave strictly-shaped chart inputs unvalidated, reject documented inputs, and bury a large frrk8s block in a schema-ignored position. Single-file diff.

  1. JSON property key typo: "resources:" (with trailing colon).

    Pre-fix the property name under frrk8s.frr.properties had a stray colon, so the resources map under frrk8s.frr was effectively unschema'd. Rename to "resources", matching the sibling shapes frrk8s.reloader.resources, frrk8s.frrMetrics.resources, frrk8s.frrStatus.resources in the same file.

  2. prometheus.serviceMonitor.interval schema mismatch.

    Pre-fix declared anyOf: integer | null, but the Prometheus convention for scrape intervals is a duration string ("30s", "1m", etc.) and charts/frr-k8s/README.md:86 already documents the field as string. Operators who set prometheus.serviceMonitor.interval: 30s were rejected by helm template with a schema error. Widen to anyOf: string | null.

  3. crds block misplaced under prometheus.

    Pre-fix the crds schema lived at properties.prometheus.crds. JSON Schema silently ignores unknown sibling keys, so the entire top-level crds map in values.yaml was unvalidated — crds.enabled: "not_a_bool" was accepted without complaint. Move it to properties.crds; the schema now catches type errors on crds.enabled and constrains crds.validationFailurePolicy to the documented enum Ignore | Fail.

  4. frrk8s block misplaced under prometheus.

    Pre-fix an entire frrk8s definition (tolerateMaster, updateStrategy, runtimeClassName, secretName, frr.{image, metricsPort, secureMetricsPort, resources}, command, reloader, frrMetrics) lived at properties.prometheus.frrk8s — a sibling of properties inside the prometheus block. Same JSON-Schema silent-ignore as Basic CI setup #3: the chart's actual frrk8s.* values went unvalidated. Merge the misplaced block into the existing top-level properties.frrk8s (which previously held only strategy, command, webhookMode). The frr.required: [enabled] rule is dropped during the move because the chart's own values.yaml does not set frrk8s.frr.enabled — enforcing it would reject the chart's default render with a confusing "missing property" error, which the pre-fix schema avoided by being in a position the validator ignored.

Special notes for your reviewer:

Verified locally (helm v3.18, v3.21):

Pre-fix:

  • helm template ... --set prometheus.serviceMonitor.interval=30s → rejected ("got string, want integer").
  • helm template ... --set crds.enabled=not_a_bool → silently accepted.
  • helm template ... --set frrk8s.tolerateMaster=not_a_bool → silently accepted.

Post-fix:

  • interval=30s → accepted.
  • crds.enabled=not_a_bool → rejected: at '/crds/enabled': got string, want boolean.
  • frrk8s.tolerateMaster=not_a_bool → rejected: at '/frrk8s/tolerateMaster': got string, want boolean.
  • Default helm template charts/frr-k8s --set crds.enabled=true renders cleanly (42 documents, 0 errors).
  • helm lint charts/frr-k8s --set crds.enabled=true clean.

Release note:

Fixed four bugs in the frr-k8s Helm chart values.schema.json: removed a trailing-colon typo on `frrk8s.frr.resources`; widened `prometheus.serviceMonitor.interval` to accept duration strings (matches Prometheus convention and the chart README); moved the `crds` block from under `prometheus` to top-level so `crds.enabled` and `crds.validationFailurePolicy` are now validated; merged the large `frrk8s` block (`tolerateMaster`, `updateStrategy`, `frr.*`, `reloader`, `frrMetrics`, etc.) into the top-level `frrk8s` schema so those fields are now validated as well.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the values.schema.json for the frr-k8s chart by updating the interval field type, correcting a typo in the resources key, and repositioning the crds block. Feedback highlights a structural error where the frrk8s block is misplaced as a sibling to properties, causing it to be ignored by JSON schema validators, and suggests merging it into the top-level definition.

Comment thread charts/frr-k8s/values.schema.json Resolved
@github-actions

Copy link
Copy Markdown

This PR has been automatically marked as stale because it has been open 30 days
with no activity. This issue will be closed in 10 days unless you do one of the following:

  • respond or perform some activity on this PR
  • have one of these labels applied: hold

Four independent bugs in `charts/frr-k8s/values.schema.json` that
together leave strictly-shaped chart inputs unvalidated, reject
documented inputs, and bury a large `frrk8s` block in a schema-ignored
position. Single-file diff.

1. JSON property key typo: `"resources:"` (with trailing colon).

   Pre-fix the property name under `frrk8s.frr.properties` had a stray
   colon, so the `resources` map under `frrk8s.frr` was effectively
   unschema'd. Rename to `"resources"`, matching the sibling shapes
   `frrk8s.reloader.resources`, `frrk8s.frrMetrics.resources`,
   `frrk8s.frrStatus.resources` in the same file.

2. `prometheus.serviceMonitor.interval` schema mismatch.

   Pre-fix declared `anyOf: integer | null`, but the Prometheus
   convention for scrape intervals is a duration string (`"30s"`,
   `"1m"`, etc.) and `charts/frr-k8s/README.md:86` already documents
   the field as `string`. Operators who set
   `prometheus.serviceMonitor.interval: 30s` were rejected by
   `helm template` with a schema error. Widen to
   `anyOf: string | null`.

3. `crds` block misplaced under `prometheus`.

   Pre-fix the `crds` schema lived at `properties.prometheus.crds`.
   JSON Schema silently ignores unknown sibling keys, so the entire
   top-level `crds` map in `values.yaml` was unvalidated —
   `crds.enabled: "not_a_bool"` was accepted without complaint. Move
   it to `properties.crds`; the schema now catches type errors on
   `crds.enabled` and constrains `crds.validationFailurePolicy` to
   the documented enum `Ignore | Fail`.

4. `frrk8s` block misplaced under `prometheus`.

   Pre-fix an entire `frrk8s` definition (`tolerateMaster`,
   `updateStrategy`, `runtimeClassName`, `secretName`, `frr.{image,
   metricsPort, secureMetricsPort, resources}`, `command`, `reloader`,
   `frrMetrics`) lived at `properties.prometheus.frrk8s` — a sibling
   of `properties` inside the `prometheus` block. Same JSON-Schema
   silent-ignore as metallb#3: the chart's actual `frrk8s.*` values went
   unvalidated. Merge the misplaced block into the existing top-level
   `properties.frrk8s` (which previously held only `strategy`,
   `command`, `webhookMode`). The `frr.required: [enabled]` rule is
   dropped during the move because the chart's own `values.yaml` does
   not set `frrk8s.frr.enabled` — enforcing it would reject the chart's
   default render with a confusing "missing property" error, which the
   pre-fix schema avoided by being in a position the validator
   ignored.

Verified locally (helm v3.18 and v3.21):

Pre-fix:

- `helm template ... --set prometheus.serviceMonitor.interval=30s` →
  rejected ("got string, want integer").
- `helm template ... --set crds.enabled=not_a_bool` → silently accepted.
- `helm template ... --set frrk8s.tolerateMaster=not_a_bool` → silently
  accepted.

Post-fix:

- `interval=30s` → accepted.
- `crds.enabled=not_a_bool` → rejected:
  `at '/crds/enabled': got string, want boolean`.
- `frrk8s.tolerateMaster=not_a_bool` → rejected:
  `at '/frrk8s/tolerateMaster': got string, want boolean`.
- Default `helm template charts/frr-k8s --set crds.enabled=true` renders
  cleanly (42 documents, 0 errors).
- `helm lint charts/frr-k8s --set crds.enabled=true` clean.

Signed-off-by: Aleksei Sviridkin <[email protected]>
@lexfrei
lexfrei force-pushed the fix/values-schema-typos branch from 891cac4 to 3d96a59 Compare June 21, 2026 14:03
@lexfrei

lexfrei commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main. Keeping this fresh while it waits for review — it's a small, self-contained chart schema fix and ready to merge.

@oribon

oribon commented Jun 23, 2026

Copy link
Copy Markdown
Member

lgtm, thanks!

@oribon
oribon merged commit 087a2ef into metallb:main Jun 23, 2026
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants