The current implementation of KubernetesResourceHandler has a limitation where using jinja's tags to reference a template from within another template, for example the include tag and the import tag.
With this limitation, we resort to duplicating files as a workaround. See an example in this pr, look at katib-config.yaml.j2 and katib-config-configmap.yaml.j2 in the katib-controller templates.
What needs to get done
Look into the usage of Jinja's tags
Implement this feature in KubernetesResourceHandler
Add an API in the base charm's kubernetes compontent
Write tests for krh and the base charm
Definition of Done
chisme's KubernetesResourceHandler and the base charm's kubernetes component allow reusing of jinja templates, tests included.
Context
The current implementation of
KubernetesResourceHandler
has a limitation where using jinja's tags to reference a template from within another template, for example the include tag and the import tag. With this limitation, we resort to duplicating files as a workaround. See an example in this pr, look atkatib-config.yaml.j2
andkatib-config-configmap.yaml.j2
in the katib-controller templates.What needs to get done
Definition of Done
chisme's
KubernetesResourceHandler
and the base charm's kubernetes component allow reusing of jinja templates, tests included.