• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SchSeba / sriov-network-operator-1 / 26741408493
63%
master: 64%

Build:
Build:
LAST BUILD BRANCH: conditions/operator-config-v2
DEFAULT BRANCH: master
Ran 01 Jun 2026 07:44AM UTC
Jobs 1
Files 108
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Jun 2026 07:30AM UTC coverage: 63.4% (-0.04%) from 63.443%
26741408493

push

github

SchSeba
Fix drain escalation race that could reboot node without full drain

A race condition existed where a node could be rebooted with production
workloads still running. The scenario:

1. Daemon requests Drain_Required (partial drain - only SR-IOV pods evicted)
2. Drain controller performs partial drain and sets DrainComplete
3. Meanwhile, a new policy requiring reboot (e.g. RDMA mode change) arrives
4. Daemon sees DrainComplete and proceeds to reboot without a full drain

The root cause is that the daemon could not distinguish whether the
completed drain was sufficient for its current (escalated) requirements.

Fix: introduce a new annotation `sriovnetwork.openshift.io/drain-action`
on SriovNetworkNodeState, owned by the drain controller, that records the
drain type actually performed. The daemon verifies this matches its current
need before proceeding to apply configuration or reboot.

The drain controller:
- Sets drain-action when starting a drain (atomically with current-state)
- Re-reads desired-state after drain completes to detect mid-drain escalation
- Resets to Draining and re-drains if desired-state escalated beyond drain-action
- Clears drain-action when returning to Idle

The daemon:
- Checks drain-action satisfies its requirement at DrainComplete
- Escalates desired-state during Draining if reboot becomes needed
- Never proceeds to apply/reboot if drain-action is insufficient

Also adds DrainStateAnnotationPredicate watch on desired-state changes and
AnnotateObjectMultiple utility to batch annotation writes in a single API call.

Signed-off-by: Sebastian Sch <sebassch@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

115 of 152 new or added lines in 6 files covered. (75.66%)

24 existing lines in 5 files now uncovered.

9543 of 15052 relevant lines covered (63.4%)

0.71 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
56.52
-0.38% pkg/daemon/daemon.go
10
66.18
-1.23% controllers/drain_controller_helper.go
8
80.42
-5.05% pkg/utils/cluster.go
5
74.24
-5.29% controllers/drain_controller.go
2
70.37
-0.46% controllers/helper.go

Coverage Regressions

Lines Coverage ∆ File
12
66.18
-1.23% controllers/drain_controller_helper.go
3
74.24
-5.29% controllers/drain_controller.go
3
79.75
-1.27% controllers/generic_network_controller.go
3
70.37
-0.46% controllers/helper.go
3
80.42
-5.05% pkg/utils/cluster.go
Jobs
ID Job ID Ran Files Coverage
1 26741408493.1 01 Jun 2026 07:43AM UTC 108
63.4
GitHub Action Run
Source Files on build 26741408493
  • Tree
  • List 108
  • Changed 8
  • Source Changed 6
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26741408493
  • d0914742 on github
  • Prev Build on master (#26566663630)
  • Next Build on fix_drain_issue (#26741474555)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc