Skip to content

OCPBUGS-85110: Move required-scc annotation to pod template for machine-api-controllers#1511

Open
liouk wants to merge 1 commit into
openshift:mainfrom
liouk:scc-pinning
Open

OCPBUGS-85110: Move required-scc annotation to pod template for machine-api-controllers#1511
liouk wants to merge 1 commit into
openshift:mainfrom
liouk:scc-pinning

Conversation

@liouk

@liouk liouk commented Jun 22, 2026

Copy link
Copy Markdown
Member

This PR fixes the location of the required-scc annotation to the pod template instead of the deployment.

Failing sippy tests: https://sippy.dptools.openshift.org/sippy-ng/tests/5.0/analysis?test=%5Bsig-auth%5D%20all%20workloads%20in%20ns%2Fopenshift-machine-api%20must%20set%20the%20%27openshift.io%2Frequired-scc%27%20annotation

Fixing this will allow us to drop the exception from the required-scc-annotation-checker monitor test.

Summary by CodeRabbit

  • Refactor
    • Adjusted OpenShift security context constraint configuration for the machine-api-controllers component, relocating the annotation to a more appropriate level within the deployment structure for improved security policy enforcement.

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jun 22, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@liouk: This pull request references Jira Issue OCPBUGS-85110, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This PR fixes the location of the required-scc annotation to the pod template instead of the deployment.

Failing sippy tests: https://sippy.dptools.openshift.org/sippy-ng/tests/5.0/analysis?test=%5Bsig-auth%5D%20all%20workloads%20in%20ns%2Fopenshift-machine-api%20must%20set%20the%20%27openshift.io%2Frequired-scc%27%20annotation

Fixing this will allow us to drop the exception from the required-scc-annotation-checker monitor test.

Instructions 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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 82966156-16a8-4e9d-a89e-7e114e2fc4bc

📥 Commits

Reviewing files that changed from the base of the PR and between d7772c6 and 9485799.

📒 Files selected for processing (1)
  • pkg/operator/sync.go

Walkthrough

The openshift.io/required-scc: restricted-v2 annotation is moved from the machine-api-controllers Deployment object's top-level metadata to the Pod template annotations. newDeployment now only retains maoOwnedAnnotation at the Deployment level, while newPodTemplateSpec clones commonPodTemplateAnnotations and adds the SCC annotation to the clone before assigning it to the Pod template.

Changes

SCC annotation relocation

Layer / File(s) Summary
Move required-scc from Deployment metadata to Pod template
pkg/operator/sync.go
newDeployment removes openshift.io/required-scc from Deployment-level annotations, keeping only maoOwnedAnnotation. newPodTemplateSpec clones commonPodTemplateAnnotations into a local map, sets openshift.io/required-scc: restricted-v2 on it, and assigns the result to the Pod template ObjectMeta.Annotations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Ginkgo test files in the PR contain multiple bare Expect(err).NotTo(HaveOccurred()) assertions without meaningful failure messages, violating requirement #4. Add failure messages to all Expect(err).NotTo(HaveOccurred()) calls, e.g., Expect(err).NotTo(HaveOccurred(), "failed to create manager").
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: moving the required-scc annotation from deployment level to pod template for machine-api-controllers, matching the core objective of the PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All Ginkgo test names in the PR are stable and deterministic with no dynamic information like timestamps, UUIDs, pod names, or generated identifiers.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. The PR only modifies operator implementation code (pkg/operator/sync.go) to move the required-scc annotation from Deployment to Pod template, making th...
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR modifies operator code (pkg/operator/sync.go) to relocate a Kubernetes annotation, not adding any Ginkgo e2e tests, making the SNO compatibility check inapplicable.
Topology-Aware Scheduling Compatibility ✅ Passed Change only moves the openshift.io/required-scc annotation from deployment to pod template metadata—this is a security/SCC configuration change, not a scheduling constraint. No affinity rules, topo...
Ote Binary Stdout Contract ✅ Passed PR modifies only Kubernetes object annotations in operator code; no process-level code, test setup, or stdout/logging changes present.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR modifies operator control plane code (pkg/operator/sync.go) to move an annotation from Deployment to Pod template level. It does not add any Ginkgo e2e tests, so the IPv6/disconnected netwo...
No-Weak-Crypto ✅ Passed The PR modifies pkg/operator/sync.go to move the required-scc annotation from deployment to pod template level. No weak cryptographic functions (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom cr...
Container-Privileges ✅ Passed The PR only moves the openshift.io/required-scc annotation from deployment-level to pod-template-level. No privileged containers, hostPID/hostNetwork/hostIPC, SYS_ADMIN capabilities, or allowPrivil...
No-Sensitive-Data-In-Logs ✅ Passed No logging that exposes passwords, tokens, API keys, PII, session IDs, or sensitive data was introduced. The PR only moves the openshift.io/required-scc annotation location from deployment to pod t...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign damdo for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@liouk: This pull request references Jira Issue OCPBUGS-85110, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

This PR fixes the location of the required-scc annotation to the pod template instead of the deployment.

Failing sippy tests: https://sippy.dptools.openshift.org/sippy-ng/tests/5.0/analysis?test=%5Bsig-auth%5D%20all%20workloads%20in%20ns%2Fopenshift-machine-api%20must%20set%20the%20%27openshift.io%2Frequired-scc%27%20annotation

Fixing this will allow us to drop the exception from the required-scc-annotation-checker monitor test.

Summary by CodeRabbit

  • Refactor
  • Adjusted OpenShift security context constraint configuration for the machine-api-controllers component, relocating the annotation to a more appropriate level within the deployment structure for improved security policy enforcement.

Instructions 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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@liouk: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn 9485799 link true /test e2e-aws-ovn
ci/prow/e2e-metal-ipi 9485799 link true /test e2e-metal-ipi
ci/prow/e2e-metal-ipi-virtualmedia 9485799 link true /test e2e-metal-ipi-virtualmedia
ci/prow/e2e-metal-ipi-ovn-ipv6 9485799 link true /test e2e-metal-ipi-ovn-ipv6

Full PR test history. Your PR dashboard.

Details

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants