chore(charts): add values.schema.json for Helm input validation - #1261
chore(charts): add values.schema.json for Helm input validation#1261ferponse wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b12d05aa6c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "global": { | ||
| "type": "null" | ||
| }, |
There was a problem hiding this comment.
Allow global values in the umbrella schema
Helm validates the final .Values object against values.schema.json on install/upgrade/template (https://helm.sh/docs/topics/charts/#schema-files), so an all-in-one install with global: {} or the global.imagePullSecrets block advertised in kubernetes/charts/opensandbox/values.yaml now fails validation because this property only permits null. Please model global as an object with additional properties so standard parent-chart global values remain accepted.
Useful? React with 👍 / 👎.
| "qps": { | ||
| "type": "integer" | ||
| } |
There was a problem hiding this comment.
Allow fractional kube-client QPS values
The controller's --kube-client-qps flag is registered with flag.Float64Var (kubernetes/cmd/controller/main.go:197) and the template emits the raw value when positive, so a custom values file with controller.kubeClient.qps: 12.5 was valid before this schema. With Helm schema validation on the final values (https://helm.sh/docs/topics/charts/#schema-files), Helm now rejects that supported fractional QPS; use JSON Schema number for qps.
Useful? React with 👍 / 👎.
|
Closing — auto-generated schemas produce incorrect types for edge cases (e.g. |
Summary
The charts have no
values.schema.json, sohelm installdoes not validate user-provided values. Invalid or mistyped values (wrong types, unexpected keys) are silently ignored until the chart fails to render or the pod fails to start.Closes #1255
Changes
values.schema.jsontoopensandbox-controller,opensandbox-serverandopensandboxcharts, generated from their respectivevalues.yamlusing thehelm-schemaplugin.github/workflows/helm-schema.yml— triggers on PRs that touchvalues.yaml, regenerates the schema and auto-commits itHow it works
The JSON Schema is derived directly from
values.yaml. Helm validates user-provided--setflags and-f values.yamloverrides against it at install/upgrade time. Examples of what gets caught:Verified locally
Notes