Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe operator runtime image changes from Distroless to scratch. The Dockerfile copies the CA certificate bundle and ChangesOperator runtime image
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The operator image retains the files and static binary needed to start under scratch, with no actionable runtime risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
4a7274f
The operator image ran on gcr.io/distroless/static-debian13:nonroot, which already gave a non-root, shell-less base. Moving the final stage to scratch drops the remaining userland the operator never touches and removes the gcr.io base-image dependency from the build. Nothing in the runtime needs what distroless/static supplied: - No outbound TLS. There is no http.Client, tls.Config or SystemCertPool in operator/ or pkg/; the apiserver client uses the projected service-account CA, not the system trust store. The CA bundle is carried over anyway so a future outbound call fails loudly rather than with a bare x509 error. - No tzdata use (no time.LoadLocation). - No writable /tmp needed. The chart sets readOnlyRootFilesystem: true, and the webhook serving cert arrives on a secret volume mounted at /tmp/k8s-webhook-server/serving-certs, a path kubelet creates. - USER is numeric, so no /etc/passwd entry is required; passwd is copied for tooling that resolves the UID. Verified by building and running the image: `--help` exits 0, and the rootfs goes from 46 MB / 1401 files to 43 MB / 17 files, of which only the binary, /etc/passwd and the CA bundle come from the image.
4a7274f to
fed066e
Compare
What does this PR do?
The operator image ran on gcr.io/distroless/static-debian13:nonroot, which already gave a non-root, shell-less base. Moving the final stage to scratch drops the remaining userland the operator never touches and removes the gcr.io base-image dependency from the build.
Nothing in the runtime needs what distroless/static supplied:
Summary by CodeRabbit