Skip to content

feat(helm): support additive extra init containers#42114

Merged
rusackas merged 1 commit into
apache:masterfrom
philipljh:feat/helm-extra-init-containers
Jul 17, 2026
Merged

feat(helm): support additive extra init containers#42114
rusackas merged 1 commit into
apache:masterfrom
philipljh:feat/helm-extra-init-containers

Conversation

@philipljh

@philipljh philipljh commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

Setting *.initContainers today replaces the chart's default init container list, so adding a single custom init container forces users to copy the chart's wait-for-postgres / wait-for-postgres-redis definitions into their values file. That copy silently drifts across chart upgrades (e.g. #40425 rewrote the wait containers from dockerize to a bash TCP wait - any values file carrying the old copy kept the stale behavior).

This adds an additive extraInitContainers value to every pod that supports init containers: supersetNode, supersetWorker, supersetCeleryBeat, supersetCeleryFlower, and init. Extras are appended after initContainers, and Kubernetes runs init containers sequentially in list order, so the chart's wait-for containers always run before user-supplied ones.

Behavior

initContainers extraInitContainers Result
default unset rendered output is identical to 0.20.0
default set chart defaults, then extras
overridden set override, then extras
[] set extras only

Notes

  • Both lists keep being evaluated through tpl (per fix(helm): Evaluate init.extraContainers templates #31878), so extras support templating (e.g. image: "{{ .Values.image.repository }}:tag").
  • New helm unittest suite (tests/init_containers_test.yaml) covers default rendering, append ordering, templating in extras, replace-plus-append, and extras-only for all five templates.
  • README.md regenerated by helm-docs; bumped to 0.21.0 .

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

helm dependency build helm/superset
helm lint helm/superset

# Unit tests
helm unittest helm/superset

# Default render is unchanged: only the chart's wait-for container
helm template t helm/superset --show-only templates/deployment.yaml \
  | sed -n '/initContainers:/,/containers:/p'

# Extras are appended after the default wait-for container
helm template t helm/superset \
  --set 'supersetNode.extraInitContainers[0].name=prepare-assets' \
  --set 'supersetNode.extraInitContainers[0].image=busybox' \
  --show-only templates/deployment.yaml \
  | sed -n '/initContainers:/,/containers:/p'

ADDITIONAL INFORMATION

  • Has associated issue: Fixes feat(helm): support additive extra init containers #42108
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

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.
@bito-code-review

bito-code-review Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #1286b6

Actionable Suggestions - 0
Review Details
  • Files reviewed - 8 · Commit Range: c46934a..c46934a
    • helm/superset/Chart.yaml
    • helm/superset/templates/deployment-beat.yaml
    • helm/superset/templates/deployment-flower.yaml
    • helm/superset/templates/deployment-worker.yaml
    • helm/superset/templates/deployment.yaml
    • helm/superset/templates/init-job.yaml
    • helm/superset/tests/init_containers_test.yaml
    • helm/superset/values.yaml
  • Files skipped - 1
    • helm/superset/README.md - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@philipljh

Copy link
Copy Markdown
Contributor Author

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.

superset-helm-lint.yml only does ct list-changed + ct lint, and the tests/ suite looks like it has only ever been a local helm unittest thing. Would be happy to wire a helm unittest step into the lint workflow as a separate follow-up, if that's worth doing 😄 . Cheers!

@rusackas
rusackas merged commit c84a154 into apache:master Jul 17, 2026
58 of 60 checks passed
@rusackas

Copy link
Copy Markdown
Member

Merged! Follow ups (or any other contributions) always welcome :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(helm): support additive extra init containers

2 participants