Repository navigation
Add chartTests.dbInteraction.enabled to skip rendering the test hook - #526
Open
inamdarmihir wants to merge 1 commit into
Open
inamdarmihir wants to merge 1 commit into
inamdarmihir wants to merge 1 commit into
Conversation
Allow disabling the helm test Pod and ConfigMap so tools that render and apply hook resources (e.g. skaffold / Cloud Deploy) do not deploy them. Defaults to true, so the default rendering is unchanged. Fixes qdrant#246
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The chart always renders the
helm.sh/hook: testPod and ConfigMap fromtemplates/tests/test-db-interaction.yaml. Tools that render the chart and apply every resource they find (Skaffold, Google Cloud Deploy,helm template | kubectl apply) then deploy the test pod and fail or leave it behind, and there is no way to opt out short of unpacking the chart and deleting thetestsdirectory (the workaround reported in #246).This adds
chartTests.dbInteraction.enabled(defaulttrue) and wraps the whole test template in it, so withenabled: falseneither the Pod nor the ConfigMap is rendered.helm templateoutput before and after, for the test template alone and for the whole chart.enabled=falsethe full-chart render has notest-db-interactionresources and nohelm.sh/hookannotations. Rendering that single template with-serrors with "could not find template", which is Helm's normal behavior for a template that renders empty.Chart.yamlis untouched, per the release process in CONTRIBUTING.Usage:
helm install qdrant qdrant/qdrant --set chartTests.dbInteraction.enabled=falseTests (
test/qdrant_chart_tests_test.go): default renders the Pod and ConfigMap with the test hook annotation; explicitenabled=truematches the default;enabled=falserenders none of the test resources while the StatefulSet is still rendered; customimageandresourcesstill apply. With the chart change stashed, the twoenabled=falsetests fail.I did not run
golangci-lint(not installed locally).Fixes #246