Skip to content

Commit 7556bbc

Browse files
authored
Merge pull request #1720 from percona/K8SPSMDB-1088
K8SPSMDB-1088: Prevent duplicate backup commands
2 parents 7e56707 + 49cb14e commit 7556bbc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/controller/perconaservermongodbbackup/backup.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func (b *Backup) Start(ctx context.Context, k8sclient client.Client, cluster *ap
8181
if err != nil {
8282
return status, err
8383
}
84+
status.State = api.BackupStateRequested
8485

8586
status = api.PerconaServerMongoDBBackupStatus{
8687
StorageName: cr.Spec.StorageName,

pkg/controller/perconaservermongodbbackup/perconaservermongodbbackup_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (r *ReconcilePerconaServerMongoDBBackup) Reconcile(ctx context.Context, req
121121

122122
if (cr.Status.State == psmdbv1.BackupStateReady || cr.Status.State == psmdbv1.BackupStateError) &&
123123
cr.ObjectMeta.DeletionTimestamp == nil {
124-
return rr, nil
124+
return reconcile.Result{}, nil
125125
}
126126

127127
status := cr.Status

0 commit comments

Comments
 (0)