Skip to content

Commit 9f3c487

Browse files
authored
fix(backup): use Status().Patch for backup status updates in reconcileSnapshotBackup (#9551)
The reconcileSnapshotBackup function was incorrectly using r.Patch() instead of r.Status().Patch() when setting backup status to pending. This is inconsistent with all other status patch operations in the controller and could cause issues since .status is a subresource that requires the status client. Signed-off-by: Armando Ruocco <[email protected]>
1 parent ea7c496 commit 9f3c487

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎internal/controller/backup_controller.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ func (r *BackupReconciler) reconcileSnapshotBackup(
529529
// TODO: shouldn't this be a failed backup?
530530
origBackup := backup.DeepCopy()
531531
backup.Status.SetAsPending()
532-
if err := r.Patch(ctx, backup, client.MergeFrom(origBackup)); err != nil {
532+
if err := r.Status().Patch(ctx, backup, client.MergeFrom(origBackup)); err != nil {
533533
return nil, err
534534
}
535535

0 commit comments

Comments
 (0)