Repository navigation
fix(helm)!: replace dockerize initContainer with bash TCP wait - #40425
Conversation
There was a problem hiding this comment.
Code Review Agent Run #29c792
Actionable Suggestions - 1
-
helm/superset/values.yaml - 1
- Semantic duplication in diff · Line 298-325
Additional Suggestions - 2
-
helm/superset/values.yaml - 2
-
Stale comment references removed section · Line 646-646The 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-832The 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
dd216d6 to
3da2a21
Compare
Code Review Agent Run #e49b4dActionable Suggestions - 1
Review 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 |
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]>
de30eed to
492b772
Compare
Code Review Agent Run #511991Actionable 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 |
sha174n
left a comment
There was a problem hiding this comment.
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]>
|
@sha174n good catch on the newline payload — switched all the probes to |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #68403eActionable 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 |
sha174n
left a comment
There was a problem hiding this comment.
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.
…e#40425) Co-authored-by: Claude Code <[email protected]>
SUMMARY
Drops
apache/superset:dockerizefrom the chart entirely. The fiveinitContainersthat gate startup on Postgres / Redis now run from the sameapache/supersetimage we're already pulling, using bash's built-in/dev/tcp/host/portredirect for the readiness probe — no externaldockerize,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:64 of the CVEs are in the bundled
dockerizeGo 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/tcpover the alternativesbusybox + nc -z: introduces an external image dependency, which is what we're trying to escape.apache/superset:dockerizeon a fresher base: kicks the can; we'd be back here in another year.Verified
/bin/bash5.2.15 is present inapache/superset:latestand supports the/dev/tcpredirect (the image's/bin/shis dash, which does not — hence the explicit/bin/bash).Changes
helm/superset/values.yaml:initImage:block.initContainersblocks (init,supersetNode,supersetWorker,supersetCeleryBeat,supersetCeleryFlower) to use{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}and a bash/dev/tcploop. The 120s timeout fromdockerize -timeout 120sis preserved via aSECONDS-based deadline. Two-port waits factor out a smallwait_forhelper.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 byhelm-docspre-commit hook (the threeinitImage.*rows are gone; version badge bumped).Compatibility
.Values.initImage.repository/tag/pullPolicy.Values.imageautomatically..Values.supersetNode.initContainers(etc.) with their own blockapache/superset:dockerizein network policies / image allowlistsBEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — chart-only change.
TESTING INSTRUCTIONS
Expect 5
wait-for-*blocks, all usingapache/superset:5.0.0(or whateverappVersionresolves to), all running/bin/bashwith a/dev/tcpprobe.To exercise the actual deploy:
ADDITIONAL INFORMATION
apache/superset:dockerizeinitContainer with bash TCP wait #40424initImagevalues block)Out of scope (good follow-ups)
apache/superset:dockerizefrom.github/workflows/docker.ymlandtag-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