diff --git a/changelogs/unreleased/2992-betta1 b/changelogs/unreleased/2992-betta1 new file mode 100644 index 000000000..e0e34fca1 --- /dev/null +++ b/changelogs/unreleased/2992-betta1 @@ -0,0 +1 @@ +Fix BSL controller to avoid invoking init() on all BSLs regardless of ValidationFrequency diff --git a/pkg/controller/backup_storage_location_controller.go b/pkg/controller/backup_storage_location_controller.go index 0cdbb4dd4..d5d9e067e 100644 --- a/pkg/controller/backup_storage_location_controller.go +++ b/pkg/controller/backup_storage_location_controller.go @@ -77,14 +77,14 @@ func (r *BackupStorageLocationReconciler) Reconcile(req ctrl.Request) (ctrl.Resu defaultFound = true } - backupStore, err := r.NewBackupStore(location, pluginManager, log) - if err != nil { - log.WithError(err).Error("Error getting a backup store") + if !storage.IsReadyToValidate(location.Spec.ValidationFrequency, location.Status.LastValidationTime, r.DefaultBackupLocationInfo, log) { + log.Debug("Backup location not ready to be validated") continue } - if !storage.IsReadyToValidate(location.Spec.ValidationFrequency, location.Status.LastValidationTime, r.DefaultBackupLocationInfo, log) { - log.Debug("Backup location not ready to be validated") + backupStore, err := r.NewBackupStore(location, pluginManager, log) + if err != nil { + log.WithError(err).Error("Error getting a backup store") continue }