Optimize string contrast judgment (#5821)
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>pull/5863/head
parent
843c70959f
commit
a761111ba1
|
@ -112,9 +112,8 @@ func getStorageAccountKey(config map[string]string) (string, error) {
|
|||
|
||||
var storageKey string
|
||||
for _, key := range *res.Keys {
|
||||
// uppercase both strings for comparison because the ListKeys call returns e.g. "FULL" but
|
||||
// the storagemgmt.Full constant in the SDK is defined as "Full".
|
||||
if strings.ToUpper(string(key.Permissions)) == strings.ToUpper(string(storagemgmt.Full)) {
|
||||
// The ListKeys call returns e.g. "FULL" but the storagemgmt.Full constant in the SDK is defined as "Full".
|
||||
if strings.EqualFold(string(key.Permissions), string(storagemgmt.Full)) {
|
||||
storageKey = *key.Value
|
||||
break
|
||||
}
|
||||
|
|
|
@ -462,9 +462,9 @@ func VeleroScheduleCreate(ctx context.Context, veleroCLI string, veleroNamespace
|
|||
|
||||
func VeleroSchedulePause(ctx context.Context, veleroCLI string, veleroNamespace string, scheduleName string) error {
|
||||
var args []string
|
||||
args = append([]string{
|
||||
args = []string{
|
||||
"--namespace", veleroNamespace, "schedule", "pause", scheduleName,
|
||||
})
|
||||
}
|
||||
if err := VeleroCmdExec(ctx, veleroCLI, args); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -473,9 +473,9 @@ func VeleroSchedulePause(ctx context.Context, veleroCLI string, veleroNamespace
|
|||
|
||||
func VeleroScheduleUnpause(ctx context.Context, veleroCLI string, veleroNamespace string, scheduleName string) error {
|
||||
var args []string
|
||||
args = append([]string{
|
||||
args = []string{
|
||||
"--namespace", veleroNamespace, "schedule", "unpause", scheduleName,
|
||||
})
|
||||
}
|
||||
if err := VeleroCmdExec(ctx, veleroCLI, args); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue