Skip to content

Commit

Permalink
Optimize string contrast judgment (#5821)
Browse files Browse the repository at this point in the history
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
  • Loading branch information
Fish-pro authored Feb 6, 2023
1 parent 843c709 commit a761111
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions pkg/repository/config/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/util/velero/velero_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit a761111

Please sign in to comment.