nmo-operator: add NHC lease blocked maintenance test on control-plane (RHWA-1255) #147
All Vouch review confidence checks passed
Residual risk 0.11 = Change Risk (0.56) × (1 − Review Confidence (0.80)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.56 · 880 lines diff across 10 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.66 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.400
Real PR Conversation Timeline
1 comments
tests/nmo-operator/tests/nmo_nhc_lease_blocked_cp.go
"IIUC it should have labels.StabilityCandidate as a new test"
test
weight: 0.55
mshitrit
gamado
Port of OCP-66800
test_nhc_node_lease_on_cpfrom ocp-edge-auto (RHWA-1255, control-plane variant of the merged OCP-65652 spec).What it verifies
The NHC CR selects
node-role.kubernetes.io/master. While NHC remediates a master (kubelet stopped over SSH), NHC holds the node's lease inmedik8s-leases, and a NodeMaintenance CR created for that master must not complete -- it stays in Running phase withstatus.lastErrorreporting that the lease is held by a different owner (the NHC). The NodeMaintenance is created only after the NMO controller deployment is verified Ready, a check the Python reference performs in this variant alone. When kubelet is restarted, remediation ends, NHC returns to Enabled and releases the lease, and the same NodeMaintenance completes and NMO takes over the lease; deleting it leaves no lease in the namespace. That completion is the positive control proving NMO was functional throughout and only the lease blocked it.The spec skips on topologies that cannot spare a control-plane node: a single-replica control plane, fewer than three control-plane nodes, an etcd quorum PodDisruptionBudget that cannot be assessed or does not tolerate exactly one disruption, or no eligible master after excluding the NMO controller's and the SSH bastion's nodes.
Shared-helper refactor
The lease interop helpers are parameterized for both variants (NHC selector key, scenario reason, maintenance and teardown budgets), with the worker variant's behavior preserved. Control-plane drains and teardown run on the
ControlPlaneMaintenanceTimeoutbudget. The control-plane topology guards are shared with the control-plane quorum spec, and both variants' recovery deletes the NodeMaintenance before the NodeHealthCheck CR, closing the window in which the NHC deletion could release the lease under a still-existing blocked maintenance.Merge order (hard dependency): this PR depends on openshift/release#89450 (the
e2e-interopCI lane that installs NHC + NMO together with the ssh-bastion step). It must merge only after that release PR is merged and the spec runs green there via/test 5.0-konflux-e2e-interop-aws. Until then the spec skips in every existing lane (no NHC installed). The same dependency applies to the sibling lease-interop PRs.Live-cluster verification (2026-11-29)
Both lease interop specs executed and passed on a cluster-bot AWS cluster (OCP 5.0.3, NHC + NMO v5.8.0, 3 control-plane + 3 workers):
NodeHealthCheck-nhc-node-lease-test, the NodeMaintenance stayed blocked for the whole 180s window withlastErrornaming the NHC, and completed after kubelet restart with NMO taking the lease; no lease remained after deletion.medik8s-leases.🤖 Generated with Claude Code