backup sync: process the default location first

Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
Steve Kriss
2018-08-28 13:19:21 -07:00
parent 7a1e6d16cc
commit 133dc185ca
4 changed files with 10 additions and 0 deletions
+5
View File
@@ -45,6 +45,7 @@ type backupSyncController struct {
backupLister listers.BackupLister
backupStorageLocationLister listers.BackupStorageLocationLister
namespace string
defaultBackupLocation string
newPluginManager func(logrus.FieldLogger) plugin.Manager
listCloudBackups func(logrus.FieldLogger, cloudprovider.ObjectStore, string) ([]*arkv1api.Backup, error)
}
@@ -55,6 +56,7 @@ func NewBackupSyncController(
backupStorageLocationInformer informers.BackupStorageLocationInformer,
syncPeriod time.Duration,
namespace string,
defaultBackupLocation string,
pluginRegistry plugin.Registry,
logger logrus.FieldLogger,
logLevel logrus.Level,
@@ -68,6 +70,7 @@ func NewBackupSyncController(
genericController: newGenericController("backup-sync", logger),
client: client,
namespace: namespace,
defaultBackupLocation: defaultBackupLocation,
backupLister: backupInformer.Lister(),
backupStorageLocationLister: backupStorageLocationInformer.Lister(),
@@ -97,6 +100,8 @@ func (c *backupSyncController) run() {
c.logger.WithError(errors.WithStack(err)).Error("Error getting backup storage locations from lister")
return
}
// sync the default location first, if it exists
locations = orderedBackupLocations(locations, c.defaultBackupLocation)
pluginManager := c.newPluginManager(c.logger)