Skip to content

Remove backup source-switch; resolve cross-cluster restore credentials directly - #441

Merged
noctarius merged 1 commit into
mainfrom
backup-rework-remove-source-switch
Aug 21, 2026
Merged

Remove backup source-switch; resolve cross-cluster restore credentials directly#441
noctarius merged 1 commit into
mainfrom
backup-rework-remove-source-switch

Conversation

@boddumanohar

Copy link
Copy Markdown
Member

Summary

  • sbcli PR #1249 (backup rework) removes the cluster-wide backup source-switch mechanism (POST /backups/source-switch, GET /backups/sources, Cluster.backup_source) — every Backup now records its own bucket location, and POST /backups/restore takes an optional s3_credentials field for the cross-cluster case instead.
  • BackupRestoreReconciler drops the switch-before/switch-back phases entirely; cross-cluster restores now go straight to the restore call.
  • For cross-cluster restores, the operator resolves the source StorageCluster's backup credentials secret and forwards it as s3_credentials on the restore request (falls back gracefully if the source cluster CR is gone, letting the backend's own precondition check surface any real error).
  • Removed the now-dead RestorePhaseSwitchingSource/RestorePhaseSwitchingSourceLocal phases and SourceSwitchedAt status field from the BackupRestore CRD; regenerated CRD manifests (config/crd/bases, dist/install.yaml, Helm chart copy).

Test plan

  • make test (full suite incl. envtest) passes
  • make lint — 0 issues
  • Added unit tests for cross-cluster credential resolution (found/missing secret, source cluster CR gone, no backup config) and the new UUID→CR lookup helper
  • Manual end-to-end verification against a backend running sbcli PR #1249 (not yet merged/deployed)

🤖 Generated with Claude Code

…ctly

sbcli PR #1249 (backup rework) removes the cluster-wide backup source-switch
mechanism (POST /backups/source-switch, GET /backups/sources, and
Cluster.backup_source) since every Backup now records its own bucket
location. Restore reads directly from wherever a backup says it lives, and
POST /backups/restore takes an optional s3_credentials field for the
cross-cluster case instead.

Update BackupRestoreReconciler to match: drop the switch-before/switch-back
phases entirely, and for cross-cluster restores resolve the source
StorageCluster's backup credentials secret and forward it as s3_credentials
on the restore call.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
// UUID matches uuid. Used to go from a cross-cluster reference (which only
// carries the backend UUID) back to the CR, to read config the backend doesn't
// expose, such as a cluster's backup credentials secret.
func ResolveClusterCRByUUID(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UUID is the cluster id?

Let's move this with a clean name into atlas/kube as part of the Resolver interface.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, let's do this separately

@noctarius
noctarius merged commit d3b6c9f into main Aug 21, 2026
16 checks passed
@noctarius
noctarius deleted the backup-rework-remove-source-switch branch August 21, 2026 13:43
noctarius pushed a commit that referenced this pull request Aug 21, 2026
…ctly (#441)

sbcli PR #1249 (backup rework) removes the cluster-wide backup source-switch
mechanism (POST /backups/source-switch, GET /backups/sources, and
Cluster.backup_source) since every Backup now records its own bucket
location. Restore reads directly from wherever a backup says it lives, and
POST /backups/restore takes an optional s3_credentials field for the
cross-cluster case instead.

Update BackupRestoreReconciler to match: drop the switch-before/switch-back
phases entirely, and for cross-cluster restores resolve the source
StorageCluster's backup credentials secret and forward it as s3_credentials
on the restore call.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
(cherry picked from commit d3b6c9f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants