Fix BSL controller to avoid invoking init() on all BSLs regardless of ValidationFrequency (#2992)

Signed-off-by: Bett, Antony <antony.bett@dell.com>
This commit is contained in:
Antony S Bett
2020-10-13 15:10:32 -04:00
committed by GitHub
parent c6aa54a009
commit 35d25c81ec
2 changed files with 6 additions and 5 deletions

View File

@@ -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
}