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

Signed-off-by: Bett, Antony <antony.bett@dell.com>
pull/3006/head
Antony S Bett 2020-10-13 15:10:32 -04:00 committed by GitHub
parent c6aa54a009
commit 35d25c81ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -0,0 +1 @@
Fix BSL controller to avoid invoking init() on all BSLs regardless of ValidationFrequency

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
}