backup sync: process the default location first

Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
Steve Kriss
2018-08-24 11:07:01 -07:00
parent 7a1e6d16cc
commit 133dc185ca
4 changed files with 10 additions and 0 deletions

View File

@@ -521,6 +521,8 @@ func (c *restoreController) fetchFromBackupStorage(backupName string, pluginMana
return backupInfo{}, errors.New("not able to fetch from backup storage")
}
// orderedBackupLocations returns a new slice with the default backup location first (if it exists),
// followed by the rest of the locations in no particular order.
func orderedBackupLocations(locations []*api.BackupStorageLocation, defaultLocationName string) []*api.BackupStorageLocation {
var result []*api.BackupStorageLocation