Skip to content

OSAC-1755: Add capabilities intersection to NetworkClass reconciler - #127

Merged
openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
SiddarthR56:OSAC-1755
Aug 6, 2026
Merged

OSAC-1755: Add capabilities intersection to NetworkClass reconciler#127
openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
SiddarthR56:OSAC-1755

Conversation

@SiddarthR56

@SiddarthR56 SiddarthR56 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • NetworkClass capabilities now synchronize automatically with configured network managers.
    • Synchronization runs periodically, with a configurable interval defaulting to five minutes.
    • Capability results reflect supported IP modes and DPU functionality.
  • Configuration

    • Added configuration for the synchronization interval.
    • Updated network manager discovery labels to use Kubernetes-compliant formats.
  • Bug Fixes

    • Improved handling of missing, unresolved, or invalid network managers without blocking other resources.

@openshift-ci-robot

openshift-ci-robot commented Aug 4, 2026

Copy link
Copy Markdown

@SiddarthR56: This pull request references OSAC-1755 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

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 requested review from rgolangh and vladikr August 4, 2026 06:37
@SiddarthR56
SiddarthR56 requested review from ori-amizur and removed request for rgolangh and vladikr August 4, 2026 06:37
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The operator now synchronizes NetworkClass capabilities from resolved network managers. It updates manager discovery labels, adds configurable periodic resynchronization, classifies missing fabric managers, wires the controller, computes capability intersections, paginates NetworkClass listing, and adds tests.

Changes

NetworkClass capability synchronization

Layer / File(s) Summary
Manager registration labels and sync configuration
.claude/rules/configuration.md, charts/operator/..., config/samples/..., pkg/networkmanager/...
Manager ConfigMaps use hyphenated label keys. Helm values and deployment templates configure OSAC_NETWORK_CLASS_SYNC_INTERVAL with a five-minute default.
Fabric manager resolution error contract
pkg/dispatcher/resolver.go
The resolver exposes ErrFabricManagerNotSet and wraps it when a NetworkClass has no fabric manager.
Capability reconciliation and tests
internal/controller/...
The reconciler watches manager ConfigMaps, lists NetworkClasses with pagination, resolves managers, computes capability intersections, updates changed objects, serializes resyncs, and handles per-object errors. Tests cover computation, equality, reconciliation, pagination, and failures.
Operator controller wiring and interval validation
cmd/main.go
Networking setup conditionally registers the reconciler when required configuration exists, validates a positive sync interval, and starts periodic synchronization.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ManagerConfigMap
  participant Operator
  participant NetworkClassCapabilitiesReconciler
  participant DispatcherResolver
  participant NetworkClassesClient
  ManagerConfigMap->>NetworkClassCapabilitiesReconciler: manager registration event
  NetworkClassCapabilitiesReconciler->>NetworkClassesClient: list NetworkClasses
  NetworkClassCapabilitiesReconciler->>DispatcherResolver: resolve managers
  DispatcherResolver-->>NetworkClassCapabilitiesReconciler: manager capabilities
  NetworkClassCapabilitiesReconciler->>NetworkClassesClient: update changed capabilities
  Operator->>NetworkClassCapabilitiesReconciler: periodic resync
Loading

Possibly related PRs

Suggested reviewers: ori-amizur, danmanor

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Ai-Attribution ⚠️ Warning AI use is explicit, but the only marker is embedded in the subject; Git parses no trailer for Assisted-by or Generated-by. No Co-Authored-By marker appears. Amend the PR commit with a valid trailer, such as Assisted-by: Claude Code <noreply@anthropic.com>, and do not use Co-Authored-By for AI tools.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding capabilities intersection to the NetworkClass reconciler.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
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.
No-Hardcoded-Secrets ✅ Passed Added-line scans found no API-key/token/password literal, private key, credential URL, vendor token pattern, or encoded secret; new values are 5m and environment/Secret references.
No-Weak-Crypto ✅ Passed The PR adds no MD5, SHA1, DES, RC4, Blowfish, or ECB usage, custom crypto, or secret/token comparisons; its equality checks only capability booleans.
No-Injection-Vectors ✅ Passed Added files contain no SQL queries, shell execution, eval/exec, pickle.loads, unsafe yaml.load, os.system, or dangerouslySetInnerHTML; structural checks found no shell calls.
Container-Privileges ✅ Passed The PR adds no privileged or host namespace settings. The operator deployment runs as non-root, drops all capabilities, and sets allowPrivilegeEscalation to false.
No-Sensitive-Data-In-Logs ✅ Passed New logs contain only NetworkClass IDs, fixed capability booleans, and operational errors; no passwords, tokens, API keys, PII, hostnames, or customer payloads are logged.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
osac-operator/internal/controller/networkclass_capabilities_controller_test.go (2)

190-210: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

This spec covers a skip path, not a failure path.

badNC references an unregistered manager. syncOne classifies that through networkmanager.IsManagerNotFound at controller line 189 and returns nil. So Reconcile never populates errs, and line 206 asserting no error is guaranteed regardless of the loop's error handling.

The errors.Join accumulation at controller lines 141-148 therefore has no coverage. Add a spec where one NetworkClass produces a genuine error — for example a getFunc that returns a gRPC failure for one ID — and assert both that Reconcile returns that error and that the healthy NetworkClass was still updated. Then rename this spec to state that it skips NetworkClasses with unregistered managers.

🤖 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
`@osac-operator/internal/controller/networkclass_capabilities_controller_test.go`
around lines 190 - 210, Rename the existing spec to describe skipping
NetworkClasses with unregistered managers, preserving its current no-error and
healthy-update assertions. Add a separate Reconcile test using the listing
client’s getFunc to return a genuine gRPC error for one NetworkClass, then
assert Reconcile returns that error while the healthy NetworkClass is still
updated, covering errors.Join accumulation.

254-262: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a case where the server over-reports Total.

The controller comment at lines 169-170 states that the resp.GetSize() == 0 check exists to stop an infinite loop when the server reports a total larger than what it returns. pagingNetworkClassClient always derives Total from len(all), so it cannot produce that state, and the guard is untested.

Add a stub that returns Total: 100 with an empty page and assert that listAllNetworkClasses returns after one call.

🧪 Suggested spec
It("stops when the server reports a total larger than the items it returns", func() {
	calls := 0
	stub := &stubNetworkClassesClient{
		listFunc: func(_ context.Context, _ *privatev1.NetworkClassesListRequest, _ ...grpc.CallOption) (*privatev1.NetworkClassesListResponse, error) {
			calls++
			return &privatev1.NetworkClassesListResponse{Size: 0, Total: 100}, nil
		},
	}

	reconciler := NewNetworkClassCapabilitiesReconciler(stub, nil, "default")
	items, err := reconciler.listAllNetworkClasses(ctx)
	Expect(err).NotTo(HaveOccurred())
	Expect(items).To(BeEmpty())
	Expect(calls).To(Equal(1))
})
🤖 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
`@osac-operator/internal/controller/networkclass_capabilities_controller_test.go`
around lines 254 - 262, Add a test alongside the existing listAllNetworkClasses
paging cases using a stubNetworkClassesClient whose listFunc returns an empty
response with Size 0 and Total 100. Assert that listAllNetworkClasses returns no
error, an empty item list, and exactly one client call, covering the
over-reported Total termination guard.
osac-operator/internal/controller/networkclass_capabilities_controller.go (2)

85-88: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff

Scope the ConfigMap watch to manager-registration ConfigMaps.

For(&corev1.ConfigMap{}, ...) caches ConfigMaps across the cluster, and managerConfigMapPredicate only drops events after storage. Use the manager's cache.Options.ByObject for corev1.ConfigMap with the networking namespace plus the manager labels in the predicate. Align osac-operator/config/rbac/role.yaml with the selector and keep read-only RBAC narrow, so the object cache and RBAC surface do not exceed what this controller needs.

🤖 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 `@osac-operator/internal/controller/networkclass_capabilities_controller.go`
around lines 85 - 88, Scope the ConfigMap cache in the controller setup around
managerConfigMapPredicate by configuring the manager cache’s
cache.Options.ByObject entry for corev1.ConfigMap with the networking namespace
and manager-label predicate. Update osac-operator/config/rbac/role.yaml to match
that namespace and object scope while retaining only read-only permissions
required by the controller.

202-208: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Set a field mask and lock the NetworkClass update.

Update has update_mask and lock fields, but this request sends only Object; the capabilities-only change is lost if the server performs a full replacement, and concurrent writer changes can be overwritten. Set update_mask to capabilities and enable lock with the current metadata.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 `@osac-operator/internal/controller/networkclass_capabilities_controller.go`
around lines 202 - 208, Update the NetworkClass request in the capabilities
update flow after nc.SetCapabilities to set update_mask to capabilities and
enable lock using the current metadata.version. Preserve the existing object and
error handling while ensuring the Update request protects concurrent changes and
applies only the capabilities field.
🤖 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.

Inline comments:
In `@osac-operator/cmd/main.go`:
- Around line 582-586: Update the validator passed to GetEnvWithDefault for
envNetworkClassSyncInterval so it accepts only durations within the required
minimum resync floor and a defined upper bound, preserving the default fallback
for invalid or out-of-range values before syncInterval reaches time.NewTicker.

---

Nitpick comments:
In
`@osac-operator/internal/controller/networkclass_capabilities_controller_test.go`:
- Around line 190-210: Rename the existing spec to describe skipping
NetworkClasses with unregistered managers, preserving its current no-error and
healthy-update assertions. Add a separate Reconcile test using the listing
client’s getFunc to return a genuine gRPC error for one NetworkClass, then
assert Reconcile returns that error while the healthy NetworkClass is still
updated, covering errors.Join accumulation.
- Around line 254-262: Add a test alongside the existing listAllNetworkClasses
paging cases using a stubNetworkClassesClient whose listFunc returns an empty
response with Size 0 and Total 100. Assert that listAllNetworkClasses returns no
error, an empty item list, and exactly one client call, covering the
over-reported Total termination guard.

In `@osac-operator/internal/controller/networkclass_capabilities_controller.go`:
- Around line 85-88: Scope the ConfigMap cache in the controller setup around
managerConfigMapPredicate by configuring the manager cache’s
cache.Options.ByObject entry for corev1.ConfigMap with the networking namespace
and manager-label predicate. Update osac-operator/config/rbac/role.yaml to match
that namespace and object scope while retaining only read-only permissions
required by the controller.
- Around line 202-208: Update the NetworkClass request in the capabilities
update flow after nc.SetCapabilities to set update_mask to capabilities and
enable lock using the current metadata.version. Preserve the existing object and
error handling while ensuring the Update request protects concurrent changes and
applies only the capabilities field.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8346f7bf-ffc9-430e-a3f0-1fa42ae027ef

📥 Commits

Reviewing files that changed from the base of the PR and between 2d02154 and e22a5fb.

📒 Files selected for processing (12)
  • osac-operator/.claude/rules/configuration.md
  • osac-operator/charts/operator/templates/deployment.yaml
  • osac-operator/charts/operator/templates/network-managers.yaml
  • osac-operator/charts/operator/values.yaml
  • osac-operator/cmd/main.go
  • osac-operator/config/samples/network-manager-fabric-netris.yaml
  • osac-operator/internal/controller/dispatcher_resolver_helpers_test.go
  • osac-operator/internal/controller/networkclass_capabilities_controller.go
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go
  • osac-operator/pkg/dispatcher/resolver.go
  • osac-operator/pkg/networkmanager/doc.go
  • osac-operator/pkg/networkmanager/types.go

Comment thread osac-operator/cmd/main.go
@SiddarthR56

Copy link
Copy Markdown
Contributor Author

/retest

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Re-triggered failed runs:

  • E2E VMaaS Full Install (#30949030919)
  • E2E BMaaS Full Install (#30949030917)
  • E2E CaaS Full Install (#30949030909)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

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

Inline comments:
In
`@osac-operator/internal/controller/networkclass_capabilities_controller_test.go`:
- Line 107: Report cleanup failures instead of discarding Delete errors in
osac-operator/internal/controller/networkclass_capabilities_controller_test.go:107-107
for fabricCM, 111-111 for k8sCM, 139-139 for fabricCM, and 193-193 for fabricCM.
Update each deferred cleanup around k8sClient.Delete to assert that deletion
succeeds.

In `@osac-operator/internal/controller/networkclass_capabilities_controller.go`:
- Around line 94-100: Update managerConfigMapPredicate to handle update events
using both ObjectOld and ObjectNew: accept the event when either ConfigMap has
the target namespace and at least one manager registration label, including when
the last label is removed. Preserve the existing filtering for other event
types, and add a regression test covering removal of the final manager label and
reconciliation triggering.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7837528f-3d65-491c-905b-0b3258b2a449

📥 Commits

Reviewing files that changed from the base of the PR and between 5fe8d2d and 6e05463.

📒 Files selected for processing (12)
  • osac-operator/.claude/rules/configuration.md
  • osac-operator/charts/operator/templates/deployment.yaml
  • osac-operator/charts/operator/templates/network-managers.yaml
  • osac-operator/charts/operator/values.yaml
  • osac-operator/cmd/main.go
  • osac-operator/config/samples/network-manager-fabric-netris.yaml
  • osac-operator/internal/controller/dispatcher_resolver_helpers_test.go
  • osac-operator/internal/controller/networkclass_capabilities_controller.go
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go
  • osac-operator/pkg/dispatcher/resolver.go
  • osac-operator/pkg/networkmanager/doc.go
  • osac-operator/pkg/networkmanager/types.go
🚧 Files skipped from review as they are similar to previous changes (10)
  • osac-operator/pkg/networkmanager/types.go
  • osac-operator/charts/operator/values.yaml
  • osac-operator/.claude/rules/configuration.md
  • osac-operator/charts/operator/templates/deployment.yaml
  • osac-operator/pkg/networkmanager/doc.go
  • osac-operator/cmd/main.go
  • osac-operator/pkg/dispatcher/resolver.go
  • osac-operator/internal/controller/dispatcher_resolver_helpers_test.go
  • osac-operator/charts/operator/templates/network-managers.yaml
  • osac-operator/config/samples/network-manager-fabric-netris.yaml

It("computes the intersection and updates the NetworkClass when capabilities changed", func() {
fabricCM := newFabricManagerConfigMap("fm-caps-fabric", namespace, "fabric-caps-1")
Expect(k8sClient.Create(ctx, fabricCM)).To(Succeed())
defer func() { _ = k8sClient.Delete(ctx, fabricCM) }()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Report ConfigMap cleanup failures.

These deferred cleanup calls discard k8sClient.Delete errors. A failed cleanup can leave a manager registration ConfigMap in the test environment and affect later specs or retries. Assert that each cleanup succeeds.

  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go#L107-L107: report deletion failure for fabricCM.
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go#L111-L111: report deletion failure for k8sCM.
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go#L139-L139: report deletion failure for fabricCM.
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go#L193-L193: report deletion failure for fabricCM.

As per path instructions, “Never ignore error returns.”

📍 Affects 1 file
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go#L107-L107 (this comment)
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go#L111-L111
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go#L139-L139
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go#L193-L193
🤖 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
`@osac-operator/internal/controller/networkclass_capabilities_controller_test.go`
at line 107, Report cleanup failures instead of discarding Delete errors in
osac-operator/internal/controller/networkclass_capabilities_controller_test.go:107-107
for fabricCM, 111-111 for k8sCM, 139-139 for fabricCM, and 193-193 for fabricCM.
Update each deferred cleanup around k8sClient.Delete to assert that deletion
succeeds.

Source: Path instructions

Comment on lines +94 to +100
return predicate.NewPredicateFuncs(func(obj clnt.Object) bool {
if obj.GetNamespace() != namespace {
return false
}
labels := obj.GetLabels()
return labels[networkmanager.LabelFabricManager] == "true" || labels[networkmanager.LabelK8sManager] == "true"
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

go_mod="$(fd -a '^go\.mod$' . | head -n 1)"
rg -n -C 3 'sigs\.k8s\.io/controller-runtime' "$go_mod"
rg -n -C 8 'managerConfigMapPredicate|NewPredicateFuncs' osac-operator/internal/controller

Repository: osac-project/osac

Length of output: 13883


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Fetch the relevant controller-runtime source for v0.24.1's NewPredicateFuncs behavior.
curl -fsSL 'https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.24.1/pkg/predicate/predicate.go' | sed -n '1,220p'

# Inspect the NetworkClass capabilities controller relevant methods around sync/reconcile.
wc -l osac-operator/internal/controller/networkclass_capabilities_controller.go
sed -n '1,240p' osac-operator/internal/controller/networkclass_capabilities_controller.go

Repository: osac-project/osac

Length of output: 18609


Handle ConfigMap label removal in managerConfigMapPredicate.

With controller-runtime NewPredicateFuncs, Update events run the filter against ObjectNew only. Removing the last manager registration label can make the Update predicate return false while ObjectOld still matched, so the ConfigMap change skips Reconcile and resyncAllLocked() until the periodic sync. For Update events, accept the event when either ObjectOld or ObjectNew has a manager registration label, and add a regression test for label removal.

🤖 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 `@osac-operator/internal/controller/networkclass_capabilities_controller.go`
around lines 94 - 100, Update managerConfigMapPredicate to handle update events
using both ObjectOld and ObjectNew: accept the event when either ConfigMap has
the target namespace and at least one manager registration label, including when
the last label is removed. Preserve the existing filtering for other event
types, and add a regression test covering removal of the final manager label and
reconciliation triggering.

@danmanor danmanor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the full diff against the unified networking design (OSAC-1433).

Design alignment — good:

  • Capabilities intersection logic directly implements the design: "Capabilities are inferred from the assigned managers and published in the NetworkClass status — the provider does not set them manually. The operator computes the intersection of capabilities declared by the fabric manager and k8sManager ConfigMaps and populates status.capabilities automatically."
  • fabric ∩ k8s when both present, fabric-only when no k8s manager — correct per design
  • All 4 capabilities covered: supports_ipv4, supports_ipv6, supports_dual_stack, dpu_support
  • ConfigMap-triggered reconciliation + periodic resync (for NC-side spec changes with no k8s event source) is a sound approach
  • Pagination on listAllNetworkClasses avoids the silent truncation from the server's default page size
  • disable_capabilities subtraction deferred to OSAC-2030 — noted in code, matches the design's spec.disableCapabilities field
  • resyncMu + TryLock on the periodic path avoids races without blocking context cancellation

Label rename (osac.openshift.io/network/fabric-managerosac.openshift.io/network-fabric-manager): K8s labels allow at most one /, so the old format was never valid. This is a bug fix. The design doc examples (OSAC-1433) and any existing ConfigMap samples will need updating to match — but since the old labels would have silently failed selectors, no deployment could have been relying on them.

Coordination note: PR #126 (OSAC-1460, dispatcher wiring) shares the dispatcher_resolver_helpers_test.go file and the ErrFabricManagerNotSet sentinel. These two PRs need to merge in a coordinated order or rebase on each other to avoid conflicts.

Assisted-by: Claude Code noreply@anthropic.com

@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danmanor, SiddarthR56

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

@danmanor

danmanor commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

/retest

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Re-triggered failed runs:

  • E2E CaaS Full Install (#31004263441)

@danmanor

danmanor commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

/retest

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Re-triggered failed runs:

  • E2E CaaS Full Install (#31004263441)

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
osac-operator/internal/controller/networkclass_capabilities_controller_test.go (1)

190-206: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise a real resolver failure.

The bad NetworkClass references an unregistered manager. syncOne handles networkmanager.IsManagerNotFound(err) as a successful skip. This test does not verify that a real resolver error is joined while the valid NetworkClass still updates.

Make the resolver return an error that is not ErrFabricManagerNotSet or IsManagerNotFound, then assert both the valid update and the returned error.

🤖 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
`@osac-operator/internal/controller/networkclass_capabilities_controller_test.go`
around lines 190 - 206, Update the test around syncOne and the stub resolver so
the bad NetworkClass produces a genuine resolver error other than
ErrFabricManagerNotSet or networkmanager.IsManagerNotFound. After Reconcile,
assert the valid NetworkClass was updated and the returned error is present and
contains the resolver failure, verifying the error is joined while processing
continues.
🤖 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
`@osac-operator/internal/controller/networkclass_capabilities_controller_test.go`:
- Around line 190-206: Update the test around syncOne and the stub resolver so
the bad NetworkClass produces a genuine resolver error other than
ErrFabricManagerNotSet or networkmanager.IsManagerNotFound. After Reconcile,
assert the valid NetworkClass was updated and the returned error is present and
contains the resolver failure, verifying the error is joined while processing
continues.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 28b4c816-d999-43a6-be04-a685539e09c1

📥 Commits

Reviewing files that changed from the base of the PR and between 6d635ef and 8b1bfdf.

📒 Files selected for processing (12)
  • osac-operator/.claude/rules/configuration.md
  • osac-operator/charts/operator/templates/deployment.yaml
  • osac-operator/charts/operator/templates/network-managers.yaml
  • osac-operator/charts/operator/values.yaml
  • osac-operator/cmd/main.go
  • osac-operator/config/samples/network-manager-fabric-netris.yaml
  • osac-operator/internal/controller/dispatcher_resolver_helpers_test.go
  • osac-operator/internal/controller/networkclass_capabilities_controller.go
  • osac-operator/internal/controller/networkclass_capabilities_controller_test.go
  • osac-operator/pkg/dispatcher/resolver.go
  • osac-operator/pkg/networkmanager/doc.go
  • osac-operator/pkg/networkmanager/types.go
🚧 Files skipped from review as they are similar to previous changes (10)
  • osac-operator/pkg/networkmanager/doc.go
  • osac-operator/charts/operator/templates/network-managers.yaml
  • osac-operator/.claude/rules/configuration.md
  • osac-operator/config/samples/network-manager-fabric-netris.yaml
  • osac-operator/charts/operator/templates/deployment.yaml
  • osac-operator/pkg/dispatcher/resolver.go
  • osac-operator/charts/operator/values.yaml
  • osac-operator/pkg/networkmanager/types.go
  • osac-operator/internal/controller/dispatcher_resolver_helpers_test.go
  • osac-operator/cmd/main.go

@openshift-merge-bot
openshift-merge-bot Bot merged commit 946697d into osac-project:main Aug 6, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants