Expose helm template option "--skip-tests" to avoid deploying test resources #231
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Helm charts can include tests that are executed after a deploy to ensure the deploy was successful. However when running
helm template
these test resources (usually Pods) end up in the resulting kubernetes yaml, and then get applied each time the terraform pipeline is run. These Pods might get scheduled before the main app becomes healthy, so they error out. Moreover these often don't have the same security controls as the main application leading to OPA policy failures (if OPA is used on the cluster).To avoid this,
helm template
has the--skip-tests
flag which is also exposed by kustomize (issue, pr).This PR adds this flag to the kustomize provider.
I decided not to change the default behavior, so tests will only be excluded from the output if one explicitly sets the
skip_tests
option to true. In the unit tests I'm reusing the existing chart, so I had to addskip_tests=true
to all other tests to avoid having the test Pod in their output. Let me know if there is a better solution to this.