Currently, Helm charts are rendered using the values.yaml file next to Chart.yaml. We need to support a way for users to test with other values. More generally, we want people to be able to specify a bunch of different combinations of values that kube-linter checks their configurations against.
There are two ways we can do this, which are not mutually exclusive:
- Support Helm's
-f and --set flags. However, this only makes sense if you lint one chart, so will require a separate lint-helm command or similar, which strictly takes the path to a Helm chart. In this case, the user will be responsible for calling kube-linter lint-helm multiple times, for each set of -f and --set arguments they want to lint against.
- One way to do this might be to allow a
.kubelinterrc directory in every Helm chart directory, where users specify this. We need to be careful about how we design this, because we want to ensure that:
- users can specify multiple renders of Helm charts -- ie, they should be able to specify a few different sets of values, have the chart be rendered with each set of values, and have each set of rendered YAML files linted independently.
- users can specify multiple values in each render. That is, just like
helm install supports multiple -f arguments, users should be able to specify multiple values.yaml files, and the order in which they are applied, for each render. Importantly, if one of these is the values.yaml file in the Chart's root directory, it should be possible for the user to specify that without having to duplicate its contents.
Finally, we should ensure that if values are specified like this, we render the chart in strict code, and actually fail if required values are not specified.
Currently, Helm charts are rendered using the
values.yamlfile next toChart.yaml. We need to support a way for users to test with other values. More generally, we want people to be able to specify a bunch of different combinations of values thatkube-linterchecks their configurations against.There are two ways we can do this, which are not mutually exclusive:
-fand--setflags. However, this only makes sense if you lint one chart, so will require a separatelint-helmcommand or similar, which strictly takes the path to a Helm chart. In this case, the user will be responsible for callingkube-linter lint-helmmultiple times, for each set of-fand--setarguments they want to lint against..kubelinterrcdirectory in every Helm chart directory, where users specify this. We need to be careful about how we design this, because we want to ensure that:helm installsupports multiple-farguments, users should be able to specify multiplevalues.yamlfiles, and the order in which they are applied, for each render. Importantly, if one of these is thevalues.yamlfile in the Chart's root directory, it should be possible for the user to specify that without having to duplicate its contents.Finally, we should ensure that if values are specified like this, we render the chart in strict code, and actually fail if required values are not specified.