Skip to content

fix(helm)!: replace dockerize initContainer with bash TCP wait - #40425

Merged
rusackas merged 3 commits into
masterfrom
fix/helm-replace-dockerize
Jun 22, 2026
Merged

rusackas merged 3 commits into
masterfrom
fix/helm-replace-dockerize

Conversation

@rusackas

Copy link
Copy Markdown
Member

SUMMARY

Drops apache/superset:dockerize from the chart entirely. The five initContainers that gate startup on Postgres / Redis now run from the same apache/superset image we're already pulling, using bash's built-in /dev/tcp/host/port redirect for the readiness probe — no external dockerize, nc, or busybox needed.

A trivy scan of the current published apache/superset:dockerize (image created 2024-05-09, base alpine 3.19.1 EOSL) found:

Severity Count Fix available
CRITICAL 3 yes
HIGH 25 yes
MEDIUM 71 yes
LOW 24 yes
Total 123 123/123

64 of the CVEs are in the bundled dockerize Go binary itself (stale Go stdlib + golang.org/x/{net,crypto}); the rest are in the alpine base packages (libcrypto3, libssl3, busybox, musl). Rebuilding the image on a fresher base would just defer the same problem; removing the dependency eliminates it.

Why bash /dev/tcp over the alternatives

  • vs busybox + nc -z: introduces an external image dependency, which is what we're trying to escape.
  • vs a Chainguard image: external registry dependency that hurts air-gapped users, and we don't need a hardened build of a non-trivial tool — we just need a TCP connect, which bash does for free.
  • vs rebuilding apache/superset:dockerize on a fresher base: kicks the can; we'd be back here in another year.

Verified /bin/bash 5.2.15 is present in apache/superset:latest and supports the /dev/tcp redirect (the image's /bin/sh is dash, which does not — hence the explicit /bin/bash).

Changes

  • helm/superset/values.yaml:
    • Removed the initImage: block.
    • Rewrote all 5 initContainers blocks (init, supersetNode, supersetWorker, supersetCeleryBeat, supersetCeleryFlower) to use {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }} and a bash /dev/tcp loop. The 120s timeout from dockerize -timeout 120s is preserved via a SECONDS-based deadline. Two-port waits factor out a small wait_for helper.
  • helm/superset/Chart.yaml: chart version 0.15.5 → 0.16.0 (minor bump per the chart's documented versioning policy — default behaviour changed; a documented value was removed).
  • helm/superset/README.md: auto-regenerated by helm-docs pre-commit hook (the three initImage.* rows are gone; version badge bumped).

Compatibility

User profile Impact
Default chart user None visible. Same wait behaviour, different binary.
Overrides .Values.initImage.repository/tag/pullPolicy Breaking. The value is no longer read. Overrides should be removed; the chart will pull from .Values.image automatically.
Fully overrides .Values.supersetNode.initContainers (etc.) with their own block None — the override still wins.
Pinned apache/superset:dockerize in network policies / image allowlists Can be removed once on chart 0.16.0.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — chart-only change.

TESTING INSTRUCTIONS

cd helm/superset
helm dependency build
helm template . --skip-tests --skip-schema-validation \
  --set supersetCeleryBeat.enabled=true \
  --set supersetCeleryFlower.enabled=true \
  | grep -B1 -A3 'name: wait-for'

Expect 5 wait-for-* blocks, all using apache/superset:5.0.0 (or whatever appVersion resolves to), all running /bin/bash with a /dev/tcp probe.

To exercise the actual deploy:

helm install superset . --create-namespace --namespace superset
kubectl -n superset logs -l app=superset -c wait-for-postgres -f
# expect: "waiting for postgres at ... (elapsed Ns)" lines then "postgres at ... is up"

ADDITIONAL INFORMATION

Out of scope (good follow-ups)

  • Stop publishing apache/superset:dockerize from .github/workflows/docker.yml and tag-release.yml. Worth one release of overlap so users on older chart versions still get fresh builds while they upgrade, then a separate PR to drop the matrix entry.

🤖 Generated with Claude Code

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review Agent Run #29c792

Actionable Suggestions - 1
  • helm/superset/values.yaml - 1
Additional Suggestions - 2
  • helm/superset/values.yaml - 2
    • Stale comment references removed section · Line 646-646
      The comment `# See supersetNode.initContainers for the rationale.` is now stale. The supersetNode.initContainers (line 299) serves as the authoritative reference, but its comment (lines 310-312) is more detailed. Either copy that explanation inline here or remove this backward reference since these sections are now identical.
    • Stale comment references removed section · Line 832-832
      The comment `# See supersetNode.initContainers for the rationale.` is now stale. Since this init section now uses the identical bash implementation as supersetNode, this backward reference creates confusion. Either copy the detailed rationale inline or remove the comment.
Review Details
  • Files reviewed - 2 · Commit Range: dd216d6..dd216d6
    • helm/superset/Chart.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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread helm/superset/values.yaml Resolved
@rusackas
rusackas requested a review from hainenber June 1, 2026 18:49
@rusackas
rusackas force-pushed the fix/helm-replace-dockerize branch from dd216d6 to 3da2a21 Compare June 10, 2026 23:09
@rusackas
rusackas requested review from sadpandajoe and sha174n June 10, 2026 23:09
@bito-code-review

bito-code-review Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #e49b4d

Actionable Suggestions - 1
  • helm/superset/values.yaml - 1
Review Details
  • Files reviewed - 2 · Commit Range: 3da2a21..de30eed
    • helm/superset/Chart.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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

claude and others added 2 commits June 17, 2026 10:51
Drops `apache/superset:dockerize` from the chart entirely. The five
initContainers that gate startup on Postgres / Redis now run from the
same `apache/superset` image we're already pulling, using bash's
built-in `/dev/tcp/host/port` redirect for the readiness probe — no
external `dockerize`, `nc`, or busybox needed.

A trivy scan of the current published `apache/superset:dockerize`
(image created 2024-05-09, alpine 3.19.1 EOSL) found 3 CRITICAL,
25 HIGH, 71 MEDIUM, and 24 LOW CVEs — 64 of them in the bundled
`dockerize` Go binary itself (stale Go stdlib + golang.org/x/{net,
crypto}); the rest in the alpine base. Rebuilding the image on a
fresher base would just defer the same problem; removing the
dependency eliminates it.

Verified `/bin/bash` 5.2.15 is present in `apache/superset:latest`
and supports the `/dev/tcp` redirect (the image's `/bin/sh` is dash,
which does not — hence the explicit `/bin/bash` invocation).
Rendered the chart with `helm template` and confirmed all five
initContainers (supersetNode, init, supersetWorker,
supersetCeleryBeat, supersetCeleryFlower) emit the expected
bash-based probe and pull the main superset image.

The 120s timeout from `dockerize -timeout 120s` is preserved via a
SECONDS-based deadline in the bash loop. Two-port waits (postgres
+ redis) factor out a small `wait_for` helper to keep the script
readable.

BREAKING CHANGE: chart `values.yaml` no longer defines `initImage`.
Operators who customised `.Values.initImage.repository/tag/pullPolicy`
must remove those overrides — they are silently ignored. Operators
who fully overrode `.Values.supersetNode.initContainers` (etc.) are
unaffected; their override still wins. Chart bumped 0.15.5 → 0.16.0.

Closes #40424

Co-Authored-By: Claude Opus 4.7 <[email protected]>
The chart lint requires a version bump when chart files change.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@rusackas
rusackas force-pushed the fix/helm-replace-dockerize branch from de30eed to 492b772 Compare June 17, 2026 17:52
@bito-code-review

bito-code-review Bot commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #511991

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 7c0d888..492b772
    • helm/superset/Chart.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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@sha174n sha174n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice cleanup. Dropping the stale dockerize image is overdue, and reusing the already-pulled app image for the probe is the right approach. The rationale for bash over the alternatives is well argued. LGTM, approving.

One optional suggestion: echo > /dev/tcp/... triggers the connect but also writes a newline into postgres/redis on each probe. Harmless, but it generates log noise (postgres logs incomplete startup packet). A pure connect avoids sending any payload:

(exec 3<>/dev/tcp/"$host"/"$port") 2>/dev/null

Worth noting too: the timeout is no longer a hard ceiling, since bash /dev/tcp has no connect timeout and only re-checks SECONDS between attempts. Fine for the usual connection-refused case; it only matters if a SYN gets dropped (e.g. a NetworkPolicy), where a single connect can block on the kernel retransmit past the deadline.

bash's `echo > /dev/tcp` writes a newline payload into the target on
each probe, which postgres logs as "incomplete startup packet". Open
the fd with `exec 3<>` instead so the probe is a pure connect.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@rusackas

Copy link
Copy Markdown
Member Author

@sha174n good catch on the newline payload — switched all the probes to (exec 3<>/dev/tcp/...) so it's a pure connect, no more incomplete startup packet noise. And yeah, the soft-ceiling caveat is real; for the connection-refused case it's fine, and I'd rather keep this dependency-free than reach for a timeout wrapper that isn't guaranteed present. Thanks for the review!

@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 5c1ef93
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a3323018ff52c00085b8b5a
😎 Deploy Preview https://deploy-preview-40425--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

bito-code-review Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #68403e

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 492b772..5c1ef93
    • helm/superset/values.yaml
  • Files skipped - 0
  • 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@sha174n sha174n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed after the pure-connect change. (exec 3<>/dev/tcp/...) is applied consistently across all five probes and is the right call: it opens the fd in a subshell purely to trigger the connect, writes nothing, and the subshell exit closes it. The incomplete startup packet noise is gone. Agree on keeping the soft-ceiling as-is rather than depending on a timeout binary that may not be present. Still LGTM.

@sha174n sha174n added the merge-if-green If approved and tests are green, please go ahead and merge it for me label Jun 19, 2026

@villebro villebro 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.

LGTM

@rusackas
rusackas merged commit c55c85f into master Jun 22, 2026
52 checks passed
@rusackas
rusackas deleted the fix/helm-replace-dockerize branch June 22, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy:helm merge-if-green If approved and tests are green, please go ahead and merge it for me risk:breaking-change Issues or PRs that will introduce breaking changes size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants