Skip to content

NO-JIRA: manifests-gen: scope provider webhooks to capi namespace#292

Open
damdo wants to merge 1 commit intoopenshift:masterfrom
damdo:manifests-gen-add-namespace-scope-to-capi-webhooks
Open

NO-JIRA: manifests-gen: scope provider webhooks to capi namespace#292
damdo wants to merge 1 commit intoopenshift:masterfrom
damdo:manifests-gen-add-namespace-scope-to-capi-webhooks

Conversation

@damdo
Copy link
Copy Markdown
Member

@damdo damdo commented May 5, 2026

Summary

  • Pins manifests-gen to the cluster-capi-operator branch that scopes all provider webhooks to the openshift-cluster-api namespace via namespaceSelector
  • This prevents webhooks from intercepting requests in other namespaces, which would fail on unsupported platforms where the webhook server is not running
  • Uses a replace directive in openshift/tools/go.mod to point at the fork branch for testing

Depends on: openshift/cluster-capi-operator#544

Summary by CodeRabbit

  • Chores
    • Restricted webhook configurations so they only apply within the OpenShift cluster API namespace.
    • Updated a build/tooling dependency to a newer manifests generation version.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

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: a206a8ea-1926-44de-bce9-355c63dec9e7

📥 Commits

Reviewing files that changed from the base of the PR and between d9ed517 and 0280198.

⛔ Files ignored due to path filters (4)
  • openshift/tools/go.sum is excluded by !**/*.sum
  • openshift/tools/vendor/github.com/openshift/cluster-capi-operator/manifests-gen/kustomization.yaml is excluded by !**/vendor/**
  • openshift/tools/vendor/github.com/openshift/cluster-capi-operator/manifests-gen/webhook-namespace-selector.yaml is excluded by !**/vendor/**
  • openshift/tools/vendor/modules.txt is excluded by !**/vendor/**
📒 Files selected for processing (2)
  • openshift/capi-operator-manifests/default/manifests.yaml
  • openshift/tools/go.mod

Walkthrough

Adds a namespaceSelector matching kubernetes.io/metadata.name: openshift-cluster-api to many webhook definitions in the CAPI operator manifests; also bumps the manifests-gen requirement version in openshift/tools/go.mod. Existing webhook rules, failurePolicy, and matchPolicy values are unchanged.

Changes

Webhook Namespace Selector + Dependency Bump

Layer / File(s) Summary
Dependency
openshift/tools/go.mod
Updated require entry for github.com/openshift/cluster-capi-operator/manifests-gen from v0.0.0-20260429150927-40757eb5602c to v0.0.0-20260506082208-390a5b10a37c.
Manifest Selector Insertion
openshift/capi-operator-manifests/default/manifests.yaml
Inserted a namespaceSelector (matching label kubernetes.io/metadata.name: openshift-cluster-api) immediately before the existing rules block for multiple webhook configurations (default.* and validation.* entries).
Retention of Existing Fields
openshift/capi-operator-manifests/default/manifests.yaml
Existing rules, failurePolicy, and matchPolicy values were left unchanged across the modified webhook entries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: scoping provider webhooks to the capi namespace via namespaceSelector additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 PR modifies only configuration files (manifests.yaml and go.mod), not Ginkgo test code. The check validates Ginkgo test names and is not applicable to this PR.
Test Structure And Quality ✅ Passed This PR modifies only a Kubernetes manifest and go.mod dependency. No Ginkgo test code exists in the changes, so the test quality check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. Changes are limited to Kubernetes manifest configuration and a Go module dependency version bump. The custom check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR modifies only Kubernetes manifests and Go module dependencies. No new Ginkgo e2e tests are added, making the SNO compatibility check not applicable to this pull request.
Topology-Aware Scheduling Compatibility ✅ Passed 1-replica Deployment with soft control-plane tolerations only. No affinity, nodeSelector, or topology constraints that would break on SNO, TNF, TNA, or HyperShift.
Ote Binary Stdout Contract ✅ Passed PR contains only Kubernetes manifest configuration and Go module dependency updates. No executable code or test suite initialization modified. OTE contract not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added in this PR. Changes are limited to Kubernetes manifests and Go module dependencies. The IPv6/disconnected network compatibility check does not apply.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@openshift-ci openshift-ci Bot requested review from RadekManak and racheljpg May 5, 2026 10:01
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damdo

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

The pull request process is described 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 openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 5, 2026
@damdo damdo changed the title UPSTREAM: <drop>: manifests-gen: scope provider webhooks to capi namespace NO-JIRA: manifests-gen: scope provider webhooks to capi namespace May 5, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 5, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@damdo: This pull request explicitly references no jira issue.

Details

In response to this:

Summary

  • Pins manifests-gen to the cluster-capi-operator branch that scopes all provider webhooks to the openshift-cluster-api namespace via namespaceSelector
  • This prevents webhooks from intercepting requests in other namespaces, which would fail on unsupported platforms where the webhook server is not running
  • Uses a replace directive in openshift/tools/go.mod to point at the fork branch for testing

Depends on: openshift/cluster-capi-operator#544

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.

@damdo
Copy link
Copy Markdown
Member Author

damdo commented May 5, 2026

/hold

Remove the pinned replace once openshift/cluster-capi-operator#544 merges

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 5, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
openshift/tools/go.mod (1)

78-79: Plan for removing the replace directive after upstream merge.

This replace directive points to a fork for testing and should be removed once the upstream PR (openshift/cluster-capi-operator#544) is merged. At that point, the require statement on line 6 should be updated to reference the official upstream version.

🤖 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 `@openshift/tools/go.mod` around lines 78 - 79, Remove the temporary replace
directive in go.mod that points to the fork (the "replace
github.com/openshift/cluster-capi-operator/manifests-gen =>
github.com/damdo/cluster-capi-operator/manifests-gen ..." entry) and update the
corresponding require for
github.com/openshift/cluster-capi-operator/manifests-gen (the require near the
top of go.mod) to the official upstream version once upstream PR 544 is merged;
ensure you run `go mod tidy` afterwards to resolve module versions and verify
builds.
🤖 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.

Nitpick comments:
In `@openshift/tools/go.mod`:
- Around line 78-79: Remove the temporary replace directive in go.mod that
points to the fork (the "replace
github.com/openshift/cluster-capi-operator/manifests-gen =>
github.com/damdo/cluster-capi-operator/manifests-gen ..." entry) and update the
corresponding require for
github.com/openshift/cluster-capi-operator/manifests-gen (the require near the
top of go.mod) to the official upstream version once upstream PR 544 is merged;
ensure you run `go mod tidy` afterwards to resolve module versions and verify
builds.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 9ec397ae-ef3f-462b-bfbb-748cf2e22a40

📥 Commits

Reviewing files that changed from the base of the PR and between a80fb57 and d9ed517.

⛔ Files ignored due to path filters (4)
  • openshift/tools/go.sum is excluded by !**/*.sum
  • openshift/tools/vendor/github.com/openshift/cluster-capi-operator/manifests-gen/kustomization.yaml is excluded by !**/vendor/**
  • openshift/tools/vendor/github.com/openshift/cluster-capi-operator/manifests-gen/webhook-namespace-selector.yaml is excluded by !**/vendor/**
  • openshift/tools/vendor/modules.txt is excluded by !**/vendor/**
📒 Files selected for processing (2)
  • openshift/capi-operator-manifests/default/manifests.yaml
  • openshift/tools/go.mod

@damdo damdo force-pushed the manifests-gen-add-namespace-scope-to-capi-webhooks branch from d9ed517 to 0280198 Compare May 6, 2026 08:55
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 6, 2026

@damdo: The following test 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-hypershift 0280198 link true /test e2e-hypershift

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.

@damdo
Copy link
Copy Markdown
Member Author

damdo commented May 6, 2026

/retest

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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