[Draft] - Adding annotations to manifests for CVO#588
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
WalkthroughThis PR adds OpenShift capability annotations ( ChangesOpenShift Capability Annotations
🎯 1 (Trivial) | ⏱️ ~3 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (12 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
manifests/0000_20_crd-compatibility-checker_08_deployment.yaml (1)
38-87: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winAdd explicit securityContext to the container spec.
The container lacks explicit
securityContextsettings. While the pod template annotation referencesrestricted-v3SCC, the coding guidelines require explicit security settings in the manifest itself.As per coding guidelines, Kubernetes manifests should include:
runAsNonRoot: truereadOnlyRootFilesystem: trueallowPrivilegeEscalation: false- Drop ALL capabilities and add only required ones
🔒 Proposed securityContext addition
- name: compatibility-requirements-controllers image: registry.ci.openshift.org/openshift:cluster-capi-operator command: - ./crd-compatibility-checker args: - --diagnostics-address=:8443 + securityContext: + runAsNonRoot: true + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: + - ALL env:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@manifests/0000_20_crd-compatibility-checker_08_deployment.yaml` around lines 38 - 87, Add an explicit securityContext to the container spec for the container named compatibility-requirements-controllers: set runAsNonRoot: true, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false, and configure capabilities to drop ["ALL"] (and only add any specific capabilities if truly required). Update the container block that contains ports/volumeMounts/readinessProbe/livenessProbe to include this securityContext so the manifest no longer relies solely on the pod SCC annotation.Source: Coding guidelines
🧹 Nitpick comments (1)
manifests/0000_20_crd-compatibility-checker_08_deployment.yaml (1)
76-79: ⚡ Quick winConsider adding resource limits to complement requests.
The container defines resource requests but no limits. As per coding guidelines, resource limits (cpu, memory) should be set on every container to prevent resource exhaustion and ensure predictable scheduling behavior.
📊 Proposed resource limits addition
resources: requests: cpu: 10m memory: 50Mi + limits: + cpu: 100m + memory: 200Mi🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@manifests/0000_20_crd-compatibility-checker_08_deployment.yaml` around lines 76 - 79, The container resource spec currently only sets requests (cpu: 10m, memory: 50Mi) in the resources block; add corresponding resource limits to prevent resource exhaustion. Update the same resources section for the container in manifests/0000_20_crd-compatibility-checker_08_deployment.yaml by adding limits.cpu and limits.memory (e.g., cpu: "100m" and memory: "128Mi" or values appropriate for the app) alongside the existing requests so both requests and limits are defined for the container.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@manifests/0000_20_crd-compatibility-checker_08_deployment.yaml`:
- Around line 38-87: Add an explicit securityContext to the container spec for
the container named compatibility-requirements-controllers: set runAsNonRoot:
true, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false, and
configure capabilities to drop ["ALL"] (and only add any specific capabilities
if truly required). Update the container block that contains
ports/volumeMounts/readinessProbe/livenessProbe to include this securityContext
so the manifest no longer relies solely on the pod SCC annotation.
---
Nitpick comments:
In `@manifests/0000_20_crd-compatibility-checker_08_deployment.yaml`:
- Around line 76-79: The container resource spec currently only sets requests
(cpu: 10m, memory: 50Mi) in the resources block; add corresponding resource
limits to prevent resource exhaustion. Update the same resources section for the
container in manifests/0000_20_crd-compatibility-checker_08_deployment.yaml by
adding limits.cpu and limits.memory (e.g., cpu: "100m" and memory: "128Mi" or
values appropriate for the app) alongside the existing requests so both requests
and limits are defined for the container.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 75630441-0604-4f2c-9c0c-02f159d02830
📒 Files selected for processing (35)
manifests/0000_20_cluster-api-tls-config_role.yamlmanifests/0000_20_crd-compatibility-checker_00_namespace.yamlmanifests/0000_20_crd-compatibility-checker_02_service_account.yamlmanifests/0000_20_crd-compatibility-checker_03_rbac_roles.yamlmanifests/0000_20_crd-compatibility-checker_04_rbac_bindings.yamlmanifests/0000_20_crd-compatibility-checker_05_metrics-service.yamlmanifests/0000_20_crd-compatibility-checker_07_webhook-service.yamlmanifests/0000_20_crd-compatibility-checker_08_deployment.yamlmanifests/0000_20_crd-compatibility-checker_09_allow-egress-operators.yamlmanifests/0000_20_crd-compatibility-checker_10_allow-ingress-to-webhook.yamlmanifests/0000_30_cluster-api-installer_00_namespace.yamlmanifests/0000_30_cluster-api-installer_00_tombstones.yamlmanifests/0000_30_cluster-api-installer_01_metrics-service.yamlmanifests/0000_30_cluster-api-installer_01_serviceaccount.yamlmanifests/0000_30_cluster-api-installer_02_clusterrole.yamlmanifests/0000_30_cluster-api-installer_03_clusterrolebinding.yamlmanifests/0000_30_cluster-api-installer_05_deployment.yamlmanifests/0000_30_cluster-api-installer_06_clusterapi.yamlmanifests/0000_30_cluster-api_00_namespace.yamlmanifests/0000_30_cluster-api_00_tombstones-4.22-tpnu.yamlmanifests/0000_30_cluster-api_01_credentials-request.yamlmanifests/0000_30_cluster-api_02_service_account.yamlmanifests/0000_30_cluster-api_02_webhook-service.yamlmanifests/0000_30_cluster-api_03_rbac_roles.yamlmanifests/0000_30_cluster-api_04_rbac_bindings.yamlmanifests/0000_30_cluster-api_10_metrics-service.yamlmanifests/0000_30_cluster-api_10_webhooks.yamlmanifests/0000_30_cluster-api_11_deployment.yamlmanifests/0000_30_cluster-api_12_clusteroperator.yamlmanifests/0000_30_cluster-api_13_allow-ingress-to-metrics-controllers.yamlmanifests/0000_30_cluster-api_14_allow-ingress-to-metrics-operators.yamlmanifests/0000_30_cluster-api_15_allow-egress-controllers.yamlmanifests/0000_30_cluster-api_16_allow-egress-operators.yamlmanifests/0000_30_cluster-api_17_default-deny.yamlmanifests/0000_30_cluster-api_18_allow-ingress-to-webhook.yaml
Manifests changes , annoations added for capability to be identified by CVO . ( linked PR )
WIP - OCPCLOUD-3368
/hold
Generated by - claude-opus-4-6(2.1.169)
Summary by CodeRabbit