Skip to content

feat(charts): add hand-crafted values.schema.json to all three charts#1263

Open
ferponse wants to merge 4 commits into
opensandbox-group:mainfrom
ferponse:feat/hand-crafted-values-schema
Open

feat(charts): add hand-crafted values.schema.json to all three charts#1263
ferponse wants to merge 4 commits into
opensandbox-group:mainfrom
ferponse:feat/hand-crafted-values-schema

Conversation

@ferponse

@ferponse ferponse commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds values.schema.json to opensandbox-controller, opensandbox-server and opensandbox charts, providing input validation at helm install / helm upgrade time.

Closes #1262

Approach: hand-crafted (not auto-generated)

Auto-generators infer types from YAML values and produce incorrect results for edge cases. This PR uses an auto-generated base and manually corrects the known issues:

Field Auto-generated (wrong) Hand-corrected Reason
controller.kubeClient.qps integer number Go flag is Float64 — accepts 12.5
opensandbox.global null anyOf: [object, null] See below

Why global needed two fixes

In YAML, a key with only comments as children has a null value:

# BEFORE — global is null (comments are not a value)
global:
  # Example: imagePullSecrets:
  #   - name: my-registry-secret

This caused helm lint to fail even against the chart's own default values because the schema expected object but got null.

Two changes were needed:

  1. opensandbox/values.yaml: global:global: {} — makes the default an explicit empty object instead of null.
  2. Schema: anyOf: [object, null] — allows null for users who install without passing any global override (Helm sends null when the key is not provided).

Validated locally

# All three charts lint cleanly
helm lint kubernetes/charts/opensandbox-controller  #
helm lint kubernetes/charts/opensandbox-server      #
helm lint kubernetes/charts/opensandbox             #

# Invalid values are rejected with a clear error
helm lint kubernetes/charts/opensandbox-controller \
  --set controller.replicaCount=abc
# [ERROR] at '/controller/replicaCount': got string, want integer ✓

# qps accepts floats (correct, it's Float64 in Go)
helm lint kubernetes/charts/opensandbox-controller \
  --set-json 'controller.kubeClient.qps=12.5'  # ✓ passes

Notes

  • No CI regeneration workflow — schemas are maintained manually alongside values.yaml.
  • All integer probe fields (initialDelaySeconds, periodSeconds, etc.) are correctly typed as integer.
  • global.additionalProperties: true allows arbitrary sub-chart global overrides without validation errors.

Auto-generated schemas were used as a base and then corrected manually:
  - controller.kubeClient.qps: integer → number (Go flag is Float64)
  - opensandbox.global: null → anyOf[object,null] (empty object, not null)
  - opensandbox/values.yaml: global: → global: {} (explicit empty map)

Validated:
  - helm lint passes for all three charts
  - invalid values (replicaCount=abc) are rejected with a clear error
  - qps=12.5 (float) is accepted with --set-json

Closes opensandbox-group#1262

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c91ce86fe

ℹ️ 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".

Comment thread kubernetes/charts/opensandbox-controller/values.schema.json
Co-authored-by: Atenea Agent <svc_atenea_gitlab@ofidona.net>
@Pangjiping Pangjiping self-assigned this Jul 12, 2026

@Pangjiping Pangjiping left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7aab37b39d

ℹ️ 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".

Comment on lines +81 to +82
"port": {
"type": "integer"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow named probe ports

If a user sets controller.livenessProbe.httpGet.port: health, Helm now rejects the values even though this Deployment declares a health container port in templates/deployment.yaml and the template would render a valid named probe port. This Kubernetes probe field is an int-or-string value, so the schema should accept strings as well as integers; the readiness probe schema below has the same regression.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/k8s For kubernetes runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(charts): add hand-crafted values.schema.json to all three charts

2 participants