← Back to Pull requests

CNTRLPLANE-2685, CNTRLPLANE-2707: integrate HCPEtcdBackup lifecycle into OADP backup flow #238

Closed
unknown closed this pull request without merging on Apr 13, 2026 13:48 UTC
View on GitHub
unknown unknown commented on Apr 07, 2026 20:54 UTC
Author

Summary

Adds etcdSnapshot as a new etcd backup method for HyperShift HostedClusters. This PR covers only the backup flow; the restore flow (with pre-signed URL generation) will follow in a separate PR.

  • Introduces etcdBackupMethod configuration key (volumeSnapshot default, etcdSnapshot for native etcd snapshots)

  • During backup, the plugin creates an HCPEtcdBackup CR that triggers a native etcdctl snapshot save and uploads the snapshot to the Velero BSL object store

  • Bridges Velero BSL credentials to the HCPEtcdBackup controller by copying and remapping the credential Secret

  • Excludes etcd pods from the backup when using etcdSnapshot to prevent CSI VolumeSnapshots

  • Stores the snapshot under Velero's backup directory structure ({prefix}/backups/{backup-name}/etcd-backup/)
  • Note: The restore flow (reading lastSuccessfulEtcdBackupURL from HC status and generating a pre-signed HTTPS URL for restoreSnapshotURL) will be implemented in a follow-up PR.

    Dependencies

    This PR depends 100% on the following HyperShift PRs being merged:

  • https://github.com/openshift/hypershift/pull/8139 - HCPEtcdBackup controller (CNTRLPLANE-2678)

  • https://github.com/openshift/hypershift/pull/8179 - LastSuccessfulEtcdBackupURL field in HostedClusterStatus (CNTRLPLANE-3173)
  • Once both are merged, a vendor update is required to remove local constants (BackupInProgressReason, BackupRejectedReason) in favor of API-defined ones.

    Related

  • Enhancement: openshift/enhancements#1945

  • Jira: CNTRLPLANE-2685
  • Changes

    | Commit | Description |
    |---|---|
    | fix(deps) | Update HyperShift API vendor to latest main (brings in HCPEtcdBackup types) |
    | feat(backup) | Integrate HCPEtcdBackup lifecycle: BSL mapping, credential copy, CR creation, polling, pod exclusion |
    | docs | Full implementation reference with architecture, flows, configuration, and troubleshooting |

    Test plan

  • Unit tests for orchestrator: BSL-to-storage mapping (AWS, Azure, unsupported), credential Secret copy and key remapping, encryption field injection, CRD existence check

  • Unit tests for validation: etcdBackupMethod and hoNamespace recognized as valid config keys

  • go build ./... passes

  • go test ./... passes

  • E2E: deploy plugin with etcdBackupMethod=etcdSnapshot, run OADP backup, verify HCPEtcdBackup CR created and snapshot uploaded

  • E2E: verify volumeSnapshot method (default) behavior is unchanged
  • 🤖 Generated with Claude Code

    Diff: 350 lines (+262 / -88) across 4 files Reviewer: tony-schndr Review duration: 8214m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 350 lines diff across 4 files
    0.42
    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.351
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #238"
    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: 42.4% (MEDIUM) · Higher = larger blast radius
    42.4%
    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: 16.8% · Safe to merge
    16.8%