← Back to Pull requests

feat: preserve pre-existing taints and cordons in fault-quarantine #1445

Closed
unknown closed this pull request without merging on Jul 03, 2026 04:58 UTC
View on GitHub
unknown unknown commented on Jul 01, 2026 17:59 UTC
Author

Summary


Closes #1424

This PR updates fault-quarantine to preserve pre-existing taints or node cordons which existed prior to the fault-quarantine applying a quarantine to a given node.

  • preserving cordons: we are adding a new node annotation called quarantineHealthEventCordonPreExisting which indicates whether the cordon existed prior to quarantine. Note that the existing quarantineHealthEventIsCordoned annotation will be preserved

  • preserving taints: we are leveraging the existing quarantineHealthEventAppliedTaints annotation but adding a new field to the taint struct called PreExisting to indicate whether a given taint should be preserved after the node is unquarantined. We do not need to add a new annotation because new fields can be added in a backwards compatible way.
  • There is also a bug fix to remove the quarantinedNodeUntaintedManually annotation when a node is quarantined since previously only the quarantinedNodeUncordonedManually annotation was removed.

    Implementation details:

  • Automatic or manual uncordons will result in the quarantineHealthEventCordonPreExisting annotation being removed (alongside the existing annotations and labels).

  • The cordon-by labels will only be added when a node is quarantined without a pre-existing cordon. This label is removed when the node is unquarantined (if it exists). Additionally, the label is not removed the node is manually uncordoned.

  • The uncordon-by label is only added on unquarantine if the cordon was not pre-existing. It is never removed explicitly and is not added on manual uncordons.

  • If only taints are applied by fault-quarantine, the cordon-by and uncordon-by labels are not added or removed.

  • The quarantinedNodeUncordonedManually annotation is applied if a node is manually uncordoned and existing taints owned by fault-quarantine will be orphaned.

  • The quarantinedNodeUntaintedManually annotation is applied if a node is manually untainted and an existing cordon or taints owned by fault-quarantine will be orphaned.

  • The quarantinedNodeUncordonedManually and quarantinedNodeUntaintedManually annotations are removed when a node is newly quarantined.
  • Examples

    Case 1: Node does not have a pre-existing cordon or taint

    Before quarantine:

    spec:
      unschedulable: false
      taints: []
    labels: {}
    annotations: {}
    

    After quarantine:

    spec:
      unschedulable: true
      taints: [{key: AggregatedNodeHealth, value: False, effect: NoSchedule}]
    labels:
      cordon-by: NVSentinel
      cordon-reason: Basic-Match-Rule
      cordon-timestamp: 2026-06-30T...
      nvsentinel-state: quarantined
    annotations:
      quarantineHealthEvent: '{"events":[...]}'
      quarantineHealthEventIsCordoned: "True"
      quarantineHealthEventAppliedTaints: '[{"key":"AggregatedNodeHealth","value":"False","effect":"NoSchedule","preExisting":false}]'
    

    After unquarantine:

    spec:
      unschedulable: false
      taints: []
    labels:
      uncordon-by: NVSentinel
      uncordon-timestamp: 2026-06-30T...
      uncordon-reason: Basic-Match-Rule-removed
    annotations: {}
    

    Case 2: Node has a pre-existing cordon and taint

    Before quarantine:

    spec:
      unschedulable: true
      taints: [{key: AggregatedNodeHealth, value: False, effect: NoSchedule}]
    labels: {}
    annotations: {}
    

    After quarantine:

    spec:
      unschedulable: true
      taints: [{key: AggregatedNodeHealth, value: False, effect: NoSchedule}]
    labels:
      nvsentinel-state: quarantined
    annotations:
      quarantineHealthEvent: '{"events":[...]}'
      quarantineHealthEventIsCordoned: "True"
      quarantineHealthEventCordonPreExisting: "True"
      quarantineHealthEventAppliedTaints: '[{"key":"AggregatedNodeHealth","value":"False","effect":"NoSchedule","preExisting":true]'
    
    

    After unquarantine:

    spec:
      unschedulable: true    
      taints: [{key: AggregatedNodeHealth, value: False, effect: NoSchedule}] 
    labels: {}                                                                                                
    annotations: {}          
    

    Case 3: Manual uncordon

    During quarantine:

    spec:
      unschedulable: false 
      taints: [{key: AggregatedNodeHealth, value: False, effect: NoSchedule}] 
    labels:
      cordon-by: NVSentinel
      cordon-reason: Basic-Match-Rule
      cordon-timestamp: 2026-06-30T...
      nvsentinel-state: quarantined
    annotations:
      quarantineHealthEvent: '{"events":[...]}'
      quarantineHealthEventIsCordoned: "True"
      quarantineHealthEventAppliedTaints: '[...]'
    

    After manual uncordon:

    spec:
      unschedulable: false 
      taints: [{key: AggregatedNodeHealth, value: False, effect: NoSchedule}]  
    labels:
      cordon-by: NVSentinel
      cordon-reason: Basic-Match-Rule
      cordon-timestamp: 2026-06-30T...
    annotations:
      quarantinedNodeUncordonedManually: "True"
    

    Case 4: Manual taint removal

    During quarantine:

    spec:
      unschedulable: true  
      taints: []            
    labels:
      cordon-by: NVSentinel
      cordon-reason: Basic-Match-Rule
      cordon-timestamp: 2026-06-30T...
      nvsentinel-state: quarantined
    annotations:
      quarantineHealthEvent: '{"events":[...]}'
      quarantineHealthEventIsCordoned: "True"
      quarantineHealthEventAppliedTaints: '[...]'
    

    After manual taint removal:

    spec:
      unschedulable: true
      taints: []
    labels:
      cordon-by: NVSentinel
      cordon-reason: Basic-Match-Rule
      cordon-timestamp: 2026-06-30T...
    annotations:
      quarantinedNodeUntaintedManually: "True"
    

    Tests

    Test coverage in reconciler_e2e_test.go:

  • TestE2E_BasicQuarantineAndUnquarantine: covers case 1 for a quarantine and unquarantine with a cordon and taint.

  • TestE2E_PreExistingCordon: covers case 2 for a quarantine and unquarantine where there's a pre-existing cordon

  • TestE2E_PreExistingTaint: covers case 2 for a quarantine and unquarantine where there's a pre-existing taint

  • TestE2ECordonAndTaint_ManualUncordon: covers case 3 above

  • TestE2ECordonAndTaint_ManualUntaint: covers case 4 above

  • TestE2E_ManualUncordonAnnotationCleanup: ensures that the quarantinedNodeUncordonedManually annotation is removed when a node is quarantined

  • TestE2E_ManualUnTaintAnnotationCleanup: ensures that the quarantinedNodeUntaintedManually annotation is removed when a node is quarantined (this is a fix for an existing bug)
  • E2E test coverage in fault_quarantine_test.go:

  • TestPreCordonedNodeHandling: ensures that a node with a pre-existing cordon has the quarantineHealthEventCordonPreExisting and quarantineHealthEventIsCordoned annotations added on quarantine and removed on unquarantine. The test also confirms that the pre-existing cordon is preserved.
  • Type of Change


  • [X] 🐛 Bug fix

  • ✨ New feature

  • 💥 Breaking change

  • 📚 Documentation

  • 🔧 Refactoring

  • 🔨 Build/CI
  • Component(s) Affected


  • Core Services

  • Documentation/CI

  • [X] Fault Management

  • Health Monitors

  • Janitor

  • Other: ____________
  • Testing


  • [X] Tests pass locally

  • [X] Manual testing completed

  • [X] No breaking changes (or documented)
  • Checklist


  • [X] Self-review completed

  • [X] Documentation updated (if needed)

  • [X] Ready for review
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Summary by CodeRabbit


    New Features
    Added a new quarantine health annotation to report when a node was already cordoned before quarantine.
    Updated taint configuration serialization to support a preExisting flag in JSON.
    Bug Fixes
    Improved node quarantine/restore behavior to preserve pre-existing cordon/taint state and to fully clean up manual untaint/uncordon artifacts.
    Improved handling when node details can’t be retrieved.
    Tests
    Expanded end-to-end and unit tests to cover pre-existing cordons/taints and manual cleanup scenarios.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: natherz97 Review duration: 2099m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1445"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 20.5% · Safe to merge
    20.5%