Using helm-unittest with library charts
helm-unittest is a tool for unit-testing Helm charts. Helm is like M4 for writing Kubernetes manifests, which are YAML files. I prefer M4, because I consider the Go templating language an abomination (mutable data structures, unclear scoping, and so on and so forth). But it’s what’s used in the project, so I don’t really have a choice. Getting back to unit testing: What helm-unittest does is render a chart and then evaluate some expressions on it to check that expected values are present. This works fine for Helm charts that are “application” charts (the regular type), but not so for “library” charts, which cannot render manifests, and only define helper templates. As I’ve written a rather inscrutable Helm library chart1, I wanted to unit test them. ...