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

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

Build:
Build:
LAST BUILD BRANCH: fix_drain_issue_v2
DEFAULT BRANCH: master
Ran 02 Jun 2026 02:35PM 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 01:22PM UTC coverage: 63.473% (+0.03%) from 63.443%
26826204253

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>
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

128 of 174 new or added lines in 6 files covered. (73.56%)

24 existing lines in 5 files now uncovered.

9561 of 15063 relevant lines covered (63.47%)

0.71 hits per line

Uncovered Changes

Lines Coverage ∆ File
14
72.99
-6.53% controllers/drain_controller.go
12
56.52
-0.38% pkg/daemon/daemon.go
11
66.55
-0.86% controllers/drain_controller_helper.go
7
81.51
-3.96% pkg/utils/cluster.go
2
70.37
-0.46% controllers/helper.go

Coverage Regressions

Lines Coverage ∆ File
11
66.55
-0.86% controllers/drain_controller_helper.go
4
72.99
-6.53% controllers/drain_controller.go
3
79.75
-1.27% controllers/generic_network_controller.go
3
70.37
-0.46% controllers/helper.go
3
81.51
-3.96% pkg/utils/cluster.go
Jobs
ID Job ID Ran Files Coverage
1 26826204253.1 02 Jun 2026 02:35PM UTC 108
63.47
GitHub Action Run
Source Files on build 26826204253
  • 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 #26826204253
  • 976dbf62 on github
  • Prev Build on master (#26566663630)
  • 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