Skip to content

feat: create ServerReadinessCheck objects from Netbox interface data#167

Open
xkonni wants to merge 1 commit into
mainfrom
feat/server-readiness-check
Open

feat: create ServerReadinessCheck objects from Netbox interface data#167
xkonni wants to merge 1 commit into
mainfrom
feat/server-readiness-check

Conversation

@xkonni

@xkonni xkonni commented Jun 18, 2026

Copy link
Copy Markdown

Summary

  • Adds --readiness-checks=network flag (opt-in, disabled by default) to enable ServerReadinessCheck creation
  • Adds --readiness-check-namespace flag to configure where objects are created (default: metal-maintenance-operator-system)
  • For each active device, fetches Netbox interfaces, filters data NICs (excludes mgmt-only, LAG, remoteboard, no-MAC), and creates/updates a ServerReadinessCheck with MAC addresses and expected carrierStatus: up
  • Uses unstructured.Unstructured — no dependency on metal-maintenance-operator module

ServerReadinessCheck is owned by metal-maintenance-operator. MMO validates actual vs expected wiring and sets a NetworkReady condition on the server. Metal-operator's ServerReadinessRuleServerReconciler then applies/removes a NoBind taint automatically.

Supersedes and closes #145 (ServerNetworkConfig — wrong type, build failures).

Test plan

  • Run full dev environment via make tilt-up in baremetal-workspace
    • verify all services healthy, and exercise the full ServerReadinessCheck flow end-to-end:
    • argora creates SRCs from Netbox, MMO sets NetworkReady condition, metal-operator applies/removes NoBind taint based on expected vs actual interface data
  • Deploy with --readiness-checks=network --readiness-check-namespace=metal-servers
  • Verify ServerReadinessCheck objects created in metal-servers namespace after reconcile
  • Verify spec.network.interfaces populated with correct MACs from Netbox
  • Verify MMO picks up the checks and sets NetworkReady condition on servers
  • Verify no NoBind taint when interfaces match, taint present when they don't
  • Verify nothing happens when --readiness-checks is not set

Adds opt-in support for creating ServerReadinessCheck objects (from
metal-maintenance-operator) per device reconciled by IronCoreReconciler.
When --readiness-checks=network is set, argora fetches interface data
from Netbox for each active device and creates a ServerReadinessCheck
in the configured namespace (--readiness-check-namespace) with the
device's MAC addresses and expected carrierStatus.

MMO then validates the actual server network interfaces against this
spec and gates server availability via a NoBind taint until the wiring
is verified.

Supersedes PR #145 (ServerNetworkConfig).
@github-actions

Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/argora/cmd/manager 0.00% (ø)
github.com/sapcc/argora/internal/controller 81.86% (-3.80%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/argora/cmd/manager/main.go 0.00% (ø) 0 0 0
github.com/sapcc/argora/internal/controller/ironcore_controller.go 69.50% (-16.66%) 200 (+41) 139 (+2) 61 (+39) 💀

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant