You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of Agones in-place upgrades we identified adding JSON schema validation as a step in validating an Agones upgrade #3766. The goal of this validation is to make any breaking changes in the Helm chart immediately apparent to the user.
JSON schema validation will validate the Agones Helm chart .Values object (note that this is not the values.yaml file itself. Details are in the Helm documentation on JSON schema files). Validation only applies to the helm install or helm upgrade, and not a direct kubectl install of the values.yaml file.
Critical User Journey
An Agones release has a breaking change. For example foo.bar moves to foo.controller.bar.
User does not read the documentation about the breaking change, and applies helm upgrade --install agones --version=$NewRelease with their current chart configuration of --set foo.bar=baz.
Before the new release is installed by Helm, the validation of the Helm .Values object fails with error similar to Error: validation failed foo.controller.bar is required.
Note that Helm currently uses https://github.com/xeipuuv/gojsonschema as its JSON validation, so all error messages come from this repo, and are not modified by Helm or Agones.
User makes changes suggested by the Helm error, and successfully re-applies helm upgrade with --set foo.controller.bar=baz.
Design Overview
Goals
Validation only applies to Agones Helm installations or upgrades.
Validate that all values required for an Agones installation are present.
Validate that all values are of the correct type.
Validate that there are no unknown given values. (Attempting to set a value at a path that does not exist.)
The validation only applies to a specific chart version. I.e. the JSON schema validation for chart 1.46 is only applied to 1.46 and not 1.45 or 1.47.
Non-Goals
Validating configurations. JSON schema does basic validation of Helm chart values (required field is present, value is of the correct type, etc.), but is not sophisticated enough to handle configuration versions.
Non-Helm Agones installations or upgrades.
Future Goals
Warning on deprecated fields. This ability is present in newer versions of JSON schema, but is not yet supported by Helm.
If unable to resolve validation error and it is a valid installation, [Break Glass and Don’t Panic] use --skip-schema-validation flag, and file an issue or PR on Agones GitHub with the details on what part of the valid validation failed.
Developer documentation
Adding or changing a Helm value must update the values.schema.json file.
There is no way of accurately generating the schema – this must be done manually.
Note
Milestone of #3766
Introduction
As part of Agones in-place upgrades we identified adding JSON schema validation as a step in validating an Agones upgrade #3766. The goal of this validation is to make any breaking changes in the Helm chart immediately apparent to the user.
JSON schema validation will validate the Agones Helm chart .Values object (note that this is not the values.yaml file itself. Details are in the Helm documentation on JSON schema files). Validation only applies to the
helm install
orhelm upgrade
, and not a directkubectl install
of thevalues.yaml
file.Critical User Journey
foo.bar
moves tofoo.controller.bar
.helm upgrade --install agones --version=$NewRelease
with their current chart configuration of--set foo.bar=baz
..Values
object fails with error similar toError: validation failed foo.controller.bar is required
.--set foo.controller.bar=baz
.Design Overview
Goals
Non-Goals
Future Goals
Core Changes Required
Create a new
values.schema.json
in agones/helm/install/agones.Testing
helm lint
to validate the standard Helm installation.helm template --debug
orhelm upgrade --install --dry-run --debug
Documentation
values.schema.json
file.The text was updated successfully, but these errors were encountered: