Skip to content

[ACM-42853] Add missing webhook containerPort declaration - #2337

Merged
msmigiel-rh merged 2 commits into
stolostron:mainfrom
dislbenn:ACM-42853-webhook-port-9443
Aug 27, 2026
Merged

msmigiel-rh merged 2 commits into
stolostron:mainfrom
dislbenn:ACM-42853-webhook-port-9443

Conversation

@dislbenn

@dislbenn dislbenn commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

The discovery-operator's validating webhook was affected by two independent
bugs that combined to cause all DiscoveredCluster create/update/delete
operations to fail with context deadline exceeded:

  1. The webhook was added to the codebase without a corresponding
    containerPort declaration in the deployment manifest.
  2. The discovery-operator-allow-webhook NetworkPolicy combined a
    namespaceSelector (matching the special openshift-host-network
    virtual namespace used by OVN-Kubernetes) with an empty podSelector: {}
    in the same from entry. This combination causes OVN-Kubernetes to
    silently drop ingress traffic from host-network pods — including
    kube-apiserver, which performs the admission webhook calls for the
    DiscoveredCluster CRD — even though the namespaceSelector alone
    matches correctly.

Both issues were verified independently on a live OVN-Kubernetes cluster
using isolated test namespaces/pods to rule out other variables.

Related Issue

ACM-42853 - Discovery operator
validating webhook configuration exists but webhook server is not running,
causing all DiscoveredCluster creation to fail with timeout errors

Changes Made

  • Added containerPort: 9443 (name: webhook-server) to the discovery-operator
    container spec in config/manager/manager.yaml
  • Removed the redundant podSelector: {} from the discovery-operator-allow-webhook
    NetworkPolicy's ingress from entry in
    bundle/manifests/discovery-operator-allow-webhook_networking.k8s.io_v1_networkpolicy.yaml
  • Regenerated bundle/manifests/discovery.clusterserviceversion.yaml via
    make manifests && make bundle to reflect the new port declaration

Screenshots (if applicable)

N/A

Checklist

  • I have tested the changes locally and they are functioning as expected.
  • I have updated the documentation (if necessary) to reflect the changes.
  • I have added/updated relevant unit tests (if applicable).
  • I have ensured that my code follows the project's coding standards.
  • I have checked for any potential security issues and addressed them.
  • I have added necessary comments to the code, especially in complex or unclear sections.
  • I have rebased my branch on top of the latest main/master branch.

Additional Notes

Verified on a live cluster in multiple stages:

  1. With only containerPort: 9443 fixed but the NetworkPolicy still
    combining namespaceSelector + podSelector: {}, webhook calls from
    kube-apiserver continued to time out.
  2. Using an isolated, unmanaged test namespace with a namespaceSelector-only
    policy against the openshift-host-network virtual namespace, a
    host-network test pod could reach a test service instantly (200,
    ~25ms).
  3. Applying the same namespaceSelector-only fix to the real
    discovery-operator-allow-webhook policy immediately restored
    connectivity from a host-network pod to the real webhook service, and
    the discovery-operator's reconcile loop began completing successfully
    with no webhook timeouts.

Note: stolostron/backplane-operator vendors a copy of these manifests
(pkg/templates/charts/toggle/discovery-operator/) via an automated sync
process. Both fixes will need to propagate there as well (either via the
automated sync after this merges and releases, or via a follow-up manual
PR) before they take effect on MCE-managed clusters.

Reviewers

/cc @cameronmwall @ngraham20

Definition of Done

  • Code is reviewed.
  • Code is tested.
  • Documentation is updated.
  • All checks and tests pass.
  • Approved by at least one reviewer.
  • Merged into the main/master branch.

The discovery-operator's validating webhook was added without a
corresponding containerPort declaration in the deployment manifest.
This went unnoticed until a NetworkPolicy enforcing port-based ingress
rules was introduced, at which point the webhook became unreachable
and all DiscoveredCluster create/update operations began failing with
context deadline exceeded timeouts.

- Add containerPort: 9443 (name: webhook-server) to the
  discovery-operator container spec in config/manager/manager.yaml
- Regenerate bundle/manifests/discovery.clusterserviceversion.yaml via
  make manifests && make bundle to reflect the new port declaration

Signed-off-by: dislbenn <dbennett@redhat.com>
@openshift-ci openshift-ci Bot added dco-signoff: no approved PR approval has been given labels Aug 27, 2026
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 32 minutes.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 74423898-44a9-46cb-99b3-8c98b3946dcb

📥 Commits

Reviewing files that changed from the base of the PR and between da3d741 and f822e70.

📒 Files selected for processing (2)
  • bundle/manifests/discovery-operator-allow-webhook_networking.k8s.io_v1_networkpolicy.yaml
  • bundle/manifests/discovery.clusterserviceversion.yaml

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bb95b55f-f748-41ae-9a2f-36d939013624

📥 Commits

Reviewing files that changed from the base of the PR and between 38d404d and da3d741.

📒 Files selected for processing (2)
  • bundle/manifests/discovery.clusterserviceversion.yaml
  • config/manager/manager.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The deployment manifests add a webhook-server container port on 9443. The ClusterServiceVersion metadata timestamp is updated.

Changes

Webhook server port exposure

Layer / File(s) Summary
Deployment port declarations
config/manager/manager.yaml, bundle/manifests/discovery.clusterserviceversion.yaml
Both deployment manifests expose container port 9443 with the name webhook-server. The ClusterServiceVersion createdAt timestamp is updated.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to da3d7

This localized manifest change declares the webhook container port needed for network policy routing, with no actionable merge-blocking risk remaining beyond normal checks and review.

Suggested reviewers: ngraham20, cameronmwall

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Title check ✅ Passed The title clearly and concisely identifies the primary change: adding the missing webhook container port declaration. It matches the pull request objectives.
Description check ✅ Passed The description is complete and relevant. It includes the purpose, related issue, detailed changes, testing evidence, checklist status, additional notes, reviewers, and definition of done. It also exp…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Full details: Description check

Explanation

The description is complete and relevant. It includes the purpose, related issue, detailed changes, testing evidence, checklist status, additional notes, reviewers, and definition of done. It also explains the NetworkPolicy context and the required downstream propagation.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

The discovery-operator-allow-webhook NetworkPolicy combined a
namespaceSelector (matching the special openshift-host-network virtual
namespace) with a podSelector: {} in the same 'from' entry.

Verified on a live OVN-Kubernetes cluster that this combination causes
ingress traffic from host-network pods (i.e. kube-apiserver, which
performs admission webhook calls for the DiscoveredCluster CRD) to be
silently dropped, even though the namespaceSelector alone matches
correctly. Removing the redundant podSelector restores connectivity.

Without this fix, DiscoveredCluster create/update/delete operations
fail with 'context deadline exceeded' calling the webhook, even when
containerPort: 9443 is correctly declared on the deployment.

Signed-off-by: dislbenn <dbennett@redhat.com>
@dislbenn
dislbenn force-pushed the ACM-42853-webhook-port-9443 branch from 6773bed to f822e70 Compare August 27, 2026 16:20
@msmigiel-rh
msmigiel-rh self-requested a review August 27, 2026 16:24
@sonarqubecloud

Copy link
Copy Markdown

@msmigiel-rh

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci

openshift-ci Bot commented Aug 27, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dislbenn, msmigiel-rh

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

@msmigiel-rh
msmigiel-rh merged commit a8eee76 into stolostron:main Aug 27, 2026
12 of 13 checks passed
@dislbenn

Copy link
Copy Markdown
Contributor Author

/cherry-pick backplane-5.0

@openshift-cherrypick-robot

Copy link
Copy Markdown
Contributor

@dislbenn: new pull request created: #2338

Details

In response to this:

/cherry-pick backplane-5.0

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.

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

Labels

approved PR approval has been given dco-signoff: yes lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants