← Back to Pull requests

nmo-operator: add NotReady node maintenance test (RHWA-1252) #128

Merged
gamado merged 4 files (340 lines) on Nov 12, 2026 14:10 UTC
View on GitHub
gamado gamado commented on Nov 09, 2026 16:43 UTC
Author

Summary

Ports OCP-71186 (Python test_nmo_for_not_ready_node) to Go: maintenance can be started on a NotReady node.

The spec stops kubelet via SSH on a control-plane node that hosts neither the NMO controller pod nor the SSH bastion, waits for the node's Ready condition to become Unknown, and creates a NodeMaintenance CR for the NotReady node. Because the drain cannot evict pods from a NotReady node, the CR is expected to reach Running -- not Succeeded -- while the node carries remediation.medik8s.io/exclude-from-remediation=true. Deleting the CR removes the maintenance taints (medik8s.io/drain, node.kubernetes.io/unschedulable) and the exclude label, and kubelet is restarted via SSH (oc debug cannot schedule a pod on a node whose kubelet is stopped, so SSH is required end to end, matching the Python invoke_ssh_on_the_node).

Cleanup is registered before the disruption and never raises: the CR is deleted with control-plane-scale budgets, kubelet is restarted only when the node is actually NotReady, and the node is waited back to Ready, uncordoned and free of both maintenance taints -- so a control-plane node can never be left NotReady for later specs. The spec skips when no SSH key is available, and also when no eligible control-plane node remains after excluding the NMO pod and bastion nodes (SNO, compact clusters).

Jira: RHWA-1252

CI dependency (blocking)

Requires openshift/release#88563 (adds ref: ssh-bastion to the NMO 5.0 jobs) to pass on Prow AWS. Merge ordering: the release PR first or together with this one. Without it this spec fails red in e2e-nmo-aws: the cluster-profile SSH key exists so the availability gate passes, but direct node SSH is blocked by security groups. Reference for the mechanism: openshift/release#82625 (the same step the NHC jobs use).

Changes

  • tests/nmo-operator/tests/nmo_notready.go -- new spec (OCP-71186), reportxml.ID("71186")

  • tests/nmo-operator/internal/nmoparams/const.go -- SSHTimeout, NodeNotReadyTimeout, MaintenanceRunningTimeout, NotReadyReason; MustGatherNMNamePrefix renamed to NMNamePrefix (now shared by the must-gather and NotReady specs)

  • tests/nmo-operator/tests/must_gather.go -- use the renamed prefix constant

  • tests/nmo-operator/README.md -- test entry 15
  • Test plan

  • go build / go vet / make lint (gofumpt + blank-line checker + golangci-lint) / ginkgo --dry-run

  • 3-agent review checklist (rules + analyzer + adversarial); all approved findings fixed

  • e2e-nmo-aws (5.0) after openshift/release#88563 merges
  • Diff: 340 lines (+255 / -85) across 4 files Reviewer: mshitrit Review duration: 4167m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.42) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 340 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.349
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #128"
    general weight: 0.35
    Reviewers
    Assignees
    gamado gamado
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.3% (MEDIUM) · Higher = larger blast radius
    42.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%