Skip to content

Conversation

@felix-kaestner
Copy link
Contributor

This package introduces a ResourceLocker type which can be used to obtain a distributed lock, based on Kubernetes leases.

@felix-kaestner felix-kaestner requested a review from a team as a code owner January 13, 2026 09:28
@felix-kaestner felix-kaestner force-pushed the resourcelock branch 2 times, most recently from f4d6170 to f7437e2 Compare January 13, 2026 14:59
@hardikdr hardikdr added the area/metal-automation Automation processes within the Metal project. label Jan 14, 2026
@hardikdr hardikdr added this to Roadmap Jan 14, 2026
@felix-kaestner felix-kaestner marked this pull request as draft January 14, 2026 08:14
@felix-kaestner felix-kaestner force-pushed the main branch 3 times, most recently from 64984b9 to f71555b Compare January 15, 2026 10:26
@felix-kaestner felix-kaestner force-pushed the resourcelock branch 3 times, most recently from 7bf3325 to e3ba929 Compare January 15, 2026 15:15
@felix-kaestner felix-kaestner changed the base branch from main to device-sample January 15, 2026 15:15
Base automatically changed from device-sample to main January 15, 2026 15:57
@felix-kaestner felix-kaestner marked this pull request as ready for review January 15, 2026 15:58
This package introduces a `ResourceLocker` type which can be used to
obtain a distributed lock, based on Kubernetes leases.

Assisted-by: Claude Code
This patch makes use of the `ResourceLocker` instance to only perform a
single operation on a network device, minimizing the rist for unexpected
side-effects of multiple controllers performing configuration changes on
a network device at the same time.
@github-actions
Copy link

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

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/cmd 0.00% (ø)
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx 63.51% (-2.27%) 👎
github.com/ironcore-dev/network-operator/internal/controller/core 67.43% (-1.92%) 👎
github.com/ironcore-dev/network-operator/internal/resourcelock 83.33% (+83.33%) 🌟

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/cmd/main.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx/bordergateway_controller.go 51.39% (-1.52%) 216 (+10) 111 (+2) 105 (+8) 👎
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx/system_controller.go 65.62% (-4.14%) 96 (+10) 63 (+3) 33 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx/vpcdomain_controller.go 75.24% (-2.31%) 206 (+10) 155 (+3) 51 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/acl_controller.go 64.36% (-3.78%) 101 (+10) 65 (+3) 36 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/banner_controller.go 62.88% (-2.69%) 132 (+10) 83 (+3) 49 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/bgp_controller.go 64.42% (-3.66%) 104 (+10) 67 (+3) 37 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/bgp_peer_controller.go 72.34% (-0.94%) 141 (+10) 102 (+6) 39 (+4) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/certificate_controller.go 66.10% (-0.56%) 118 (+10) 78 (+6) 40 (+4) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/dns_controller.go 64.36% (-3.78%) 101 (+10) 65 (+3) 36 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/evpninstance_controller.go 74.27% (-2.75%) 171 (+10) 127 (+3) 44 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/interface_controller.go 78.37% (-1.69%) 356 (+10) 279 (+2) 77 (+8) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/isis_controller.go 60.18% (-3.90%) 113 (+10) 68 (+2) 45 (+8) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/managementaccess_controller.go 56.78% (-2.48%) 118 (+10) 67 (+3) 51 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/ntp_controller.go 64.36% (-3.78%) 101 (+10) 65 (+3) 36 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/nve_controller.go 68.00% (-3.05%) 200 (+10) 136 (+1) 64 (+9) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/ospf_controller.go 59.72% (-2.22%) 144 (+10) 86 (+3) 58 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/pim_controller.go 61.06% (-3.02%) 113 (+10) 69 (+3) 44 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/prefixset_controller.go 68.32% (-0.91%) 101 (+10) 69 (+6) 32 (+4) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/routingpolicy_controller.go 72.19% (-0.86%) 151 (+10) 109 (+6) 42 (+4) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/snmp_controller.go 64.36% (-3.78%) 101 (+10) 65 (+3) 36 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/syslog_controller.go 64.36% (-3.78%) 101 (+10) 65 (+3) 36 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/user_controller.go 61.36% (-2.57%) 132 (+10) 81 (+3) 51 (+7) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/vlan_controller.go 67.54% (-0.73%) 114 (+10) 77 (+6) 37 (+4) 👎
github.com/ironcore-dev/network-operator/internal/controller/core/vrf_controller.go 67.92% (-0.83%) 106 (+10) 72 (+6) 34 (+4) 👎
github.com/ironcore-dev/network-operator/internal/resourcelock/resourcelock.go 83.33% (+83.33%) 96 (+96) 80 (+80) 16 (+16) 🌟

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/cisco/nx/suite_test.go
  • github.com/ironcore-dev/network-operator/internal/controller/core/nve_controller_test.go
  • github.com/ironcore-dev/network-operator/internal/controller/core/routingpolicy_controller_test.go
  • github.com/ironcore-dev/network-operator/internal/controller/core/suite_test.go
  • github.com/ironcore-dev/network-operator/internal/resourcelock/resourcelock_test.go

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

Labels

area/metal-automation Automation processes within the Metal project.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants