feat(helm): support additive extra init containers#42114
Conversation
Fixes apache#42108 Setting *.initContainers replaces the chart's default wait-for containers, forcing users to copy them into their values just to add one custom init container. Add extraInitContainers to supersetNode, supersetWorker, supersetCeleryBeat, supersetCeleryFlower and init, appended after initContainers so the chart defaults keep running first. Default rendering is unchanged.
Code Review Agent Run #1286b6Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
rusackas
left a comment
There was a problem hiding this comment.
Thanks @philipljh, LGTM!
Curious though if helm unittest actually runs anywhere in CI, or if tests/init_containers_test.yaml only gets exercised locally? Looks like superset-helm-lint.yml just runs ct lint today, but that's true of the whole tests/ directory already, so not blocking this one necessarily.
|
|
Merged! Follow ups (or any other contributions) always welcome :D |
SUMMARY
Setting
*.initContainerstoday replaces the chart's default init container list, so adding a single custom init container forces users to copy the chart'swait-for-postgres/wait-for-postgres-redisdefinitions into their values file. That copy silently drifts across chart upgrades (e.g. #40425 rewrote the wait containers fromdockerizeto a bash TCP wait - any values file carrying the old copy kept the stale behavior).This adds an additive
extraInitContainersvalue to every pod that supports init containers:supersetNode,supersetWorker,supersetCeleryBeat,supersetCeleryFlower, andinit. Extras are appended afterinitContainers, and Kubernetes runs init containers sequentially in list order, so the chart's wait-for containers always run before user-supplied ones.Behavior
initContainersextraInitContainers[]Notes
tpl(per fix(helm): Evaluateinit.extraContainerstemplates #31878), so extras support templating (e.g.image: "{{ .Values.image.repository }}:tag").helm unittestsuite (tests/init_containers_test.yaml) covers default rendering, append ordering, templating in extras, replace-plus-append, and extras-only for all five templates.README.mdregenerated by helm-docs; bumped to 0.21.0 .BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION