Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync values file and template. Add error handling #29

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

5nafu
Copy link

@5nafu 5nafu commented Mar 15, 2024

This PR syncs the values.yaml to the variables used inside the templates by adding missing defaults and moving tolerations, ... back to top level as described in #27.

Additionally added a jsonschema file for validation of supplied values.

The error message would look like this (example from helm lint with an "old-style" values.yaml)

==> Linting chart
[ERROR] values.yaml: - daemonset: Additional property tolerations is not allowed

[ERROR] templates/: values don't meet the specifications of the schema(s) in the following chart(s):
docker-hub-rate-limit-exporter:
- daemonset: Additional property tolerations is not allowed


Error: 1 chart(s) linted, 1 chart(s) failed

According to helm/helm#12842 custom error messages are not yet possible.

Notes:

  • I did not add very detailed properties for complex objects like securityContext in order to keep maintainability.
  • I commented out service.nodePort, hostNetwork and hostPID as these variables do not have a default value and the linter would have flagged them when left empty.
  • The schema file was generated by losisin/helm-values-schema-json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant