chart-testing
chart-testing copied to clipboard
Add support for testing charts with post renderer
This PR adds two new features that allow for testing of charts that have/require the use of post renderer hooks
-
Allow the user to provide a setup script that can be run to install additional tools or packages like
ytt
orkustomize
-
Allow the user to provide a default path to look for post-renderer hooks. There is an assumption that post-renderer hooks will be in a consistent (relative to the chart) location for charts, it would be overwhelming to try and support different paths for different charts.
Signed-off-by: Paul Czarkowski [email protected]
What this PR does / why we need it:
Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #
Special notes for your reviewer:
Thanks @paulczar for adding this. I have some concerns regarding the way it is implemented, though.
-
I don't think chart-testing should handle the installation of additional software. Using a post-renderer is an advanced feature. If someone wants to use it they should take care of installing required software upfront, e. g. by creating a custom Docker image.
-
chart-testing is designed such that it automatically runs across any charts that may have changed in the repo. You may want to use a post-renderer for some but not all of them. Using a CLI flag does not consider this. That's why we have values files for testing in a chart's
ci
folder. We could come up with a similar naming convention for post-renderers and add them to this directory as well. chart-testing would then run any combination of values files and post-renderers it finds for a chart.
I also think a good place for that would be the /ci dir. Same as where you put glob pattern '*-values.yaml' files ('post-renderer.sh')?
-
Makes sense, I was hesitant adding the setup-script as it was.
-
Ahhh yeah my thought was that the owner of the charts repo would decide on a convention for post-renderer hooks and any charts that needs a post-renderer would follow that convention, hence the cli option. So maybe what I should do is have it would look for
./ci/ct-chart-config.yaml
where we could allow the chart to specify some config settings, the first of which beingpost-renderer-path:
. If the cli option--post-renderer
istrue
it would then read that config setting.
@paulczar Maybe just have a convention similar to what we have for values file, e. g. *-post-renderer*
?
Agree a glob pattern for this would be good to test combinations as we do now with '*-values.yaml' files
can this already be done with helm-extra-args
?
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This PR was closed because it has been stalled for 10 days with no activity.