Skip to content

Commit

Permalink
fix(backup): set backup error if backup target invalid
Browse files Browse the repository at this point in the history
When starting a backup monitor, it will start to take a snapshot
backup procedure and it will be failed if the s3 backup target is
invalid (nfs backup target will be not be failed because of timeout
and test the backup when it is in progress.)
Set the backup state as `Error` if starting the backup procedure
returns an error.

Ref: 1249

Signed-off-by: James Lu <james.lu@suse.com>
(cherry picked from commit e278ba0)
  • Loading branch information
mantissahz authored and mergify[bot] committed Jul 27, 2023
1 parent 8ce69c8 commit 6675326
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controller/backup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ func (bc *BackupController) reconcile(backupName string) (err error) {

monitor, err := bc.checkMonitor(backup, volume, backupTarget)
if err != nil {
if backup.Status.State == longhorn.BackupStateError {
log.WithError(err).Warnf("Failed to enable the backup monitor for backup %v", backup.Name)
return nil
}
return err
}

Expand Down

0 comments on commit 6675326

Please sign in to comment.