As a result, the output of the template that is generated mimics what would be created in a helm template or helm install --dry-run instead of a true helm install (which would support additional functionality like verifying the output from lookup calls).
To support the ability for tests to mimic parsing the template generated during a Helm install instead, we should allow the ability for users to set USE_CLUSTER_FROM_ENV=1, which should populate the client used in this call with the one generated by finding the current KUBECONFIG from the environment (which can be done by leveraging the code here).
This KUBECONFIG should then be used to grab the latest Helm release secret for the given chart, which will contain the information necessary to create a chart.Template off of.
Currently, Hull utilizes
e.Render
instead ofe.RenderWithClient
in the following code used to generate a template:https://github.com/aiyengar2/hull/blob/33cf243dca452b3fa1d5d471d6bcd6806e2f4205/pkg/chart/chart.go#L75-L78
As a result, the output of the template that is generated mimics what would be created in a
helm template
orhelm install --dry-run
instead of a truehelm install
(which would support additional functionality like verifying the output from lookup calls).To support the ability for tests to mimic parsing the template generated during a Helm install instead, we should allow the ability for users to set
USE_CLUSTER_FROM_ENV=1
, which should populate the client used in this call with the one generated by finding the current KUBECONFIG from the environment (which can be done by leveraging the code here).This KUBECONFIG should then be used to grab the latest Helm release secret for the given chart, which will contain the information necessary to create a
chart.Template
off of.