Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

feat(charts): validate chart values w/ json schema #1890

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

michelleN
Copy link
Contributor

@michelleN michelleN commented Oct 22, 2020

Description:
This PR adds a values.schema.json file to indicate which values are required, type, description, examples, defaults. The schema file will help prevent us from accidentally changing the values file and breaking things as well as ensuring we are specifying the required values any time this chart is installed.

From the docs (https://helm.sh/docs/topics/charts/#schema-files):

This schema will be applied to the values to validate it. Validation occurs when any of the following commands are invoked:

  • helm install
  • helm upgrade
  • helm lint
  • helm template

Affected area:

  • New Functionality [ ]
  • Documentation [ ]
  • Install [X ]
  • Control Plane [ ]
  • CLI Tool [ ]
  • Certificate Management [ ]
  • Networking [ ]
  • Metrics [ ]
  • SMI Policy [ ]
  • Security [ ]
  • Tests [ ]
  • CI System [ ]
  • Performance [ ]
  • Other [ ]

Please answer the following questions with yes/no.

  • Does this change contain code from or inspired by another project? If so, did you notify the maintainers and provide attribution?
    No

+ add values.schema.json file to indicate which
values are required, type, description
@michelleN michelleN requested a review from a team as a code owner October 22, 2020 05:00
"type": "object",
"title": "The OpenServiceMesh schema",
"description": "The top level required key in the values file.",
"default": {},
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed the example in Helm's docs doesn't include defaults. How much value is there in adding them here? And what could go wrong if these defaults get out of sync with values.yaml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a really good point. I had them in here because they're an option in json schema but Helm is not using them. Let me go ahead and take them out.

"type": "string",
"title": "The envoyLogLevel schema",
"description": "Envoy log level.",
"default": "error",
Copy link
Contributor

Choose a reason for hiding this comment

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

A pattern matching the acceptable values might be beneficial here.

@michelleN michelleN merged commit dbb3ec7 into openservicemesh:main Oct 22, 2020
@michelleN michelleN deleted the chart-schema branch October 22, 2020 16:26
draychev pushed a commit to draychev/osm that referenced this pull request Oct 28, 2020
)

* feat(charts): validate chart values w/ json schema

+ add values.schema.json file to indicate which
values are required, type, description and patterns for accepted values
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants