Open mjnagel opened 8 months ago
fwiw this would be great in uds-common. I know y'all aren't really using it though ❤️
Would like to scope this to start as a common linting task addition to do two of the mentioned chart linting tasks:
helm lint --strict
helm template
Both of these should use a task input for path
to denote the path to run linting against (ex: src/promtail/chart
). This input can default to chart
since that is a common path in most uds packages. Once added to uds-common it should be pulled into core's lint task are run on a loop for all charts under src/**
. Then the task should be called as part of our lint-check job.
Is your feature request related to a problem? Please describe.
Currently our helm charts are "tested" at deploy time only, and excluded from the minimal
yamllint
checks we do. It would be nice to have a fast failure on the helm charts if they are malformed, and also some standard linting against them.Describe the solution you'd like
A few suggestions to run in CI/locally, tied to the current lint tasks likely:
helm lint --strict src/**/chart
: this is very basic linting, but would catch small things quicklyhelm template <chart>
: Good smoke test that the chart will template successfully with default values, but would not validate edge cases with certain values configurationhelm template <chart>
+yamllint
against the templated files: This would be nice to catch weird/wrong formatting, a bit more advanced and longer to runDescribe alternatives you've considered
I think there are things that might be too far for "smoke testing", such as using https://github.com/helm/chart-testing/tree/main , but could be worth exploring for some of the specific charts we maintain (keycloak/authservice?).
Additional context
This was spawned out of attempting to use
yamllint
against charts and hitting issues due to the helm template formatting. It would be nice to havelinting/validation run before our longer CI kicks off.