mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-18 14:04:39 +00:00
Merge pull request #7222 from qiuming-best/adjust-bsl-setting-logic
Adjust velero server side default backup location setting logic
This commit is contained in:
@@ -125,7 +125,13 @@ func (o *SetOptions) Run(c *cobra.Command, f client.Factory) error {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
if len(defalutBSLs.Items) > 0 {
|
||||
return errors.New("there is already a default backup storage location")
|
||||
if len(defalutBSLs.Items) == 1 && defalutBSLs.Items[0].Name == o.Name {
|
||||
// the default backup storage location is the one we want to set
|
||||
// so we do not need to do anything
|
||||
fmt.Printf("Backup storage location %q is already the default backup storage location.\n", o.Name)
|
||||
return nil
|
||||
}
|
||||
return errors.New("there are already exist default backup storage locations, please unset them first")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user