Skip to content

Separate DeviceProvider into focused interfaces#364

Merged
felix-kaestner merged 2 commits into
mainfrom
fix/openconfig
May 20, 2026
Merged

Separate DeviceProvider into focused interfaces#364
felix-kaestner merged 2 commits into
mainfrom
fix/openconfig

Conversation

@felix-kaestner
Copy link
Copy Markdown
Contributor

Split the monolithic DeviceProvider interface into three distinct interfaces based on their concerns:

  • DeviceProvider: read-only device metadata (GetDeviceInfo, ListPorts, GetLastRebootTime)
  • MaintenanceProvider: disruptive lifecycle operations (Reboot, FactoryReset)
  • ProvisioningProvider: ZTP/POAP lifecycle (added Reprovision alongside existing HashProvisioningPassword and VerifyProvisioned)

The DeviceController no longer hard-gates on DeviceProvider. Providers that don't implement it (e.g. openconfig) now go through a minimal reconciliation path that tracks reachability without fetching hardware metadata. Maintenance actions probe for the correct interface per operation and emit a warning event if unsupported.

Fixes #278

The E2E test built images with custom names
(ironcore.dev/network-operator:test) that did not match the
image reference in config/manager/manager.yaml
(ghcr.io/ironcore-dev/network-operator). Since the deploy
target does not override the kustomization image, the Kind
cluster pulled the stale image from the registry instead of
using the locally built one.

Fix by using the Makefile default image names in the E2E test
constants so that docker-build, kind-load, and the deployment
all reference the same image.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Split the monolithic DeviceProvider interface into three distinct
interfaces based on their concerns:

- DeviceProvider: read-only device metadata (GetDeviceInfo, ListPorts,
  GetLastRebootTime)
- MaintenanceProvider: disruptive lifecycle operations (Reboot,
  FactoryReset)
- ProvisioningProvider: ZTP/POAP lifecycle (added Reprovision alongside
  existing HashProvisioningPassword and VerifyProvisioned)

The DeviceController no longer hard-gates on DeviceProvider. Providers
that don't implement it (e.g. openconfig) now go through a minimal
reconciliation path that tracks reachability without fetching hardware
metadata. Maintenance actions probe for the correct interface per
operation and emit a warning event if unsupported.

Fixes #278

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
@felix-kaestner felix-kaestner disabled auto-merge May 20, 2026 12:08
@github-actions
Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/internal/controller/core 62.61% (-0.15%) 👎
github.com/ironcore-dev/network-operator/internal/provider 52.00% (ø)
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos 9.95% (+0.00%) 👍
github.com/ironcore-dev/network-operator/internal/provisioning 76.15% (ø)
github.com/ironcore-dev/network-operator/test/e2e 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/internal/controller/core/device_controller.go 65.56% (-6.71%) 241 (+21) 158 (-1) 83 (+22) 👎
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/provider.go 0.06% (ø) 1779 1 1778
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/system.go 3.23% (+0.10%) 31 (-1) 1 30 (-1) 👍
github.com/ironcore-dev/network-operator/internal/provider/provider.go 52.00% (ø) 25 13 12

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ironcore-dev/network-operator/internal/controller/core/suite_test.go
  • github.com/ironcore-dev/network-operator/internal/provisioning/http_test.go
  • github.com/ironcore-dev/network-operator/test/e2e/e2e_suite_test.go
  • github.com/ironcore-dev/network-operator/test/e2e/e2e_test.go

@felix-kaestner felix-kaestner merged commit 116b1f6 into main May 20, 2026
20 checks passed
@felix-kaestner felix-kaestner deleted the fix/openconfig branch May 20, 2026 12:17
@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label May 21, 2026
@hardikdr hardikdr added this to Roadmap May 21, 2026
@github-project-automation github-project-automation Bot moved this to Done in Roadmap May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations. size/L

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

SONiC OS: Is the OpenConfig provider currently supported?

3 participants