From 7286d24c352ec4598269918c61270763c9c5665f Mon Sep 17 00:00:00 2001 From: Scott Seago Date: Wed, 3 Dec 2025 16:55:59 -0500 Subject: [PATCH] Updates for merge conflict and to refine reconciler queueing logic Signed-off-by: Scott Seago --- pkg/controller/backup_queue_controller.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/controller/backup_queue_controller.go b/pkg/controller/backup_queue_controller.go index 556250b3e..c5cdc9461 100644 --- a/pkg/controller/backup_queue_controller.go +++ b/pkg/controller/backup_queue_controller.go @@ -127,7 +127,8 @@ func (r *backupQueueReconciler) SetupWithManager(mgr ctrl.Manager) error { return oldBackup.Status.Phase == velerov1api.BackupPhaseInProgress && newBackup.Status.Phase != velerov1api.BackupPhaseInProgress || oldBackup.Status.Phase != velerov1api.BackupPhaseQueued && - newBackup.Status.Phase == velerov1api.BackupPhaseQueued + newBackup.Status.Phase == velerov1api.BackupPhaseQueued && + r.backupTracker.RunningCount() < r.concurrentBackups }, CreateFunc: func(event.CreateEvent) bool { return false @@ -197,7 +198,13 @@ func (r *backupQueueReconciler) checkForEarlierRunnableBackups(backup *velerov1a } func namespacesForBackup(backup *velerov1api.Backup, clusterNamespaces []string) []string { - return collections.NewNamespaceIncludesExcludes().Includes(backup.Spec.IncludedNamespaces...).Excludes(backup.Spec.ExcludedNamespaces...).ActiveNamespaces(clusterNamespaces).ResolveNamespaceList() + // Ignore error here. If a backup has invalid namespace wildcards, the backup controller + // will validate and fail it. Consider the ns list empty for conflict detection purposes. + nsList, err := collections.NewNamespaceIncludesExcludes().Includes(backup.Spec.IncludedNamespaces...).Excludes(backup.Spec.ExcludedNamespaces...).ActiveNamespaces(clusterNamespaces).ResolveNamespaceList() + if err != nil { + return []string{} + } + return nsList } func (r *backupQueueReconciler) getMaxQueuePosition(lister *queuedBackupsLister) int { queuedBackups := lister.orderedQueued()