Commodore provides opinionated tenant-aware management of Kapitan inventories and templates. Commodore uses Kapitan for the heavy lifting of rendering templates and resolving a hierachical configuration structure.
We add go-jsonnet as a dependency, set use_go_jsonnet=True when calling kapitan.targets.render_targets() and replace our direct usages of jsonnet for rendering jsonnetfile.jsonnet for components and for postprocessing with go-jsonnet.
Additionally, we fix an oversight in the Jsonnet import callback used by the Commodore postprocessing where we should return a full path to the imported file but instead returned the filename only. With go-jsonnet this leads to an import loop for lib/kube.libjsonnet for the builtin helm_namespace filter. Interestingly, the same issue doesn't occur when using the same include in a Jsonnet postprocessing filter. Note that with C++ jsonnet we never had any issues with the previous import callback implementation. Additionally, note that Kapitan returns the full path in the import callback, cf. https://github.com/kapicorp/kapitan/blob/dfa5d33bd3e74db5fad84086c833402bc892da6f/kapitan/resources.py#L211-L257
Checklist
[x] Keep pull requests small so they can be easily reviewed.
[x] Update tests.
[x] Categorize the PR by setting a good title and adding one of the labels:
bug, enhancement, documentation, change, breaking, dependency, internal
as they show up in the changelog
We add go-jsonnet as a dependency, set
use_go_jsonnet=True
when callingkapitan.targets.render_targets()
and replace our direct usages of jsonnet for rendering jsonnetfile.jsonnet for components and for postprocessing with go-jsonnet.Additionally, we fix an oversight in the Jsonnet import callback used by the Commodore postprocessing where we should return a full path to the imported file but instead returned the filename only. With go-jsonnet this leads to an import loop for
lib/kube.libjsonnet
for the builtinhelm_namespace
filter. Interestingly, the same issue doesn't occur when using the same include in a Jsonnet postprocessing filter. Note that with C++ jsonnet we never had any issues with the previous import callback implementation. Additionally, note that Kapitan returns the full path in the import callback, cf. https://github.com/kapicorp/kapitan/blob/dfa5d33bd3e74db5fad84086c833402bc892da6f/kapitan/resources.py#L211-L257Checklist
bug
,enhancement
,documentation
,change
,breaking
,dependency
,internal
as they show up in the changelog