Skip to content

Commit

Permalink
Update observedGeneration for mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
mrajashree committed Sep 1, 2020
1 parent 36fb5d1 commit 5ca1317
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controllers/backup/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ func (h *handler) OnBackupChange(_ string, backup *v1.Backup) (*v1.Backup, error
if backup.Spec.Schedule == "" {
// Backup CR was meant for one-time backup, and the backup has been completed. Probably here from UpdateStatus call
logrus.Infof("Backup CR %v has been processed for one-time backup, returning", backup.Name)
// This could also mean backup CR was updated from recurring to one-time, in which case observedGeneration needs to be updated
if backup.Generation != backup.Status.ObservedGeneration {
backup.Status.ObservedGeneration = backup.Generation
return h.backups.UpdateStatus(backup)
}
return backup, nil
}
if backup.Status.NextSnapshotAt != "" {
Expand Down

0 comments on commit 5ca1317

Please sign in to comment.