Add terminationMessagePolicy for OCP 4.21 conformance#505
Add terminationMessagePolicy for OCP 4.21 conformance#505dustman9000 wants to merge 1 commit intoopenshift:masterfrom
Conversation
WalkthroughAdded Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 10✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
deploy/04_operator.yaml (1)
31-54: Add explicit containersecurityContextto both Deployment manifests for compliance scanning clarity.The current manifests rely on the
restricted-v2SCC annotation but lack explicit container-level security settings. AddingsecurityContextwill resolve CKV_K8S_20 and CKV_K8S_23 findings and improve portability across environments.Apply this configuration to both
deploy/04_operator.yamlanddeploy_pko/Deployment-configure-alertmanager-operator.yaml.gotmpl:Hardening patch
containers: - name: configure-alertmanager-operator image: quay.io/redhat-services-prod/camo-hcm-tenant/configure-alertmanager-operator-master/configure-alertmanager-operator-master@sha256:06210e55ea90935f8e1ccea48b1b3db2694de6bac4564596d306dd94333933b9 + securityContext: + allowPrivilegeEscalation: false + runAsNonRoot: true + capabilities: + drop: + - ALL + seccompProfile: + type: RuntimeDefault command: - configure-alertmanager-operator🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@deploy/04_operator.yaml` around lines 31 - 54, Add an explicit container-level securityContext to the configure-alertmanager-operator container in both Deployment manifests (the one shown and the corresponding deploy_pko template) to satisfy CKV_K8S_20/23: set runAsNonRoot: true and a non-zero runAsUser (e.g., 1000), set allowPrivilegeEscalation: false, set readOnlyRootFilesystem: true, and drop all Linux capabilities (capabilities: drop: ["ALL"]); apply this block under the container spec for the container named configure-alertmanager-operator in both manifests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@deploy/04_operator.yaml`:
- Around line 31-54: Add an explicit container-level securityContext to the
configure-alertmanager-operator container in both Deployment manifests (the one
shown and the corresponding deploy_pko template) to satisfy CKV_K8S_20/23: set
runAsNonRoot: true and a non-zero runAsUser (e.g., 1000), set
allowPrivilegeEscalation: false, set readOnlyRootFilesystem: true, and drop all
Linux capabilities (capabilities: drop: ["ALL"]); apply this block under the
container spec for the container named configure-alertmanager-operator in both
manifests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 12a8437a-5563-4bf0-be94-88168d6c9842
📒 Files selected for processing (2)
deploy/04_operator.yamldeploy_pko/Deployment-configure-alertmanager-operator.yaml.gotmpl
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #505 +/- ##
=======================================
Coverage 68.26% 68.26%
=======================================
Files 8 8
Lines 1087 1087
=======================================
Hits 742 742
Misses 315 315
Partials 30 30 🚀 New features to boost your workflow:
|
|
/retest |
|
@dustman9000: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dustman9000, nephomaniac 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 |
|
@dustman9000, re the failing jobs, this may need to be rebased to pick up the konflux updates/fixes(?) |
Adds terminationMessagePolicy: FallbackToLogsOnError to the operator container spec in both OLM (deploy/) and PKO (deploy_pko/) deployment manifests, and regenerates PKO test fixtures. Replaces openshift#505 which could not be rebased. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
terminationMessagePolicy: FallbackToLogsOnErrorto the operator container spec in both OLM (deploy/) and PKO (deploy_pko/) deployment manifestsThe
required-sccannotation was already present in both files. TheterminationMessagePolicyensures container termination messages capture log output on error, which is required for OCP 4.21 conformance.Test plan
terminationMessagePolicyappears in pod spec viaoc get pod -o yamlSummary by CodeRabbit