Set readOnlyRootFilesystem for console plugin container - #413
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: razo7 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe console plugin Deployment enables ChangesConsole plugin container hardening
Reconciliation test synchronization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The console plugin container lacks readOnlyRootFilesystem, failing the certsuite immutable root filesystem check. Add emptyDir volume mounts for the paths the UBI9 nginx-120 S2I image needs at runtime: - /opt/app-root/etc/passwd (subPath): NSS wrapper passwd generation - /var/log/nginx: S2I log symlink creation - /var/lib/nginx/tmp: nginx proxy and temp buffers - /run: nginx PID file Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b9ebcf1 to
49805bb
Compare
The "with invalid kind" and "with missing namespace" tests assert NHC phase synchronously after a 2-second sleep. When the reconciler takes longer to complete the REST mapper lookup, the phase is still empty, causing intermittent failures. Replace the synchronous Default assertion with Eventually polling, matching the pattern already used by the "template is deleted after NHC creation" test in the same context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Why we need this PR
The console plugin container lacks
readOnlyRootFilesystem: true, failing the certsuite immutable root filesystem check. The UBI9 nginx-120 S2I image needs several paths writable at runtime, so emptyDir mounts are added for each.Changes made
In
config/optional/console-plugin/deployment.yaml:readOnlyRootFilesystem: truein the container securityContext/opt/app-root/etc/passwd(subPath): NSS wrapper writes the running user entry from a template at startup/var/log/nginx: S2I run script creates stdout/stderr symlinks here/var/lib/nginx/tmp: nginx proxy and temp buffers/run: nginx PID fileIn
internal/controller/nodehealthcheck_controller_test.go:Eventuallypolling (matching the existing pattern for the "template is deleted after NHC creation" test)How to test
Prerequisites
Requires the console image from medik8s/node-remediation-console#111 for the nginx logging fix.
Related
Summary by CodeRabbit
Security
Bug Fixes