Skip to content

Commit

Permalink
Merge pull request #1320 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1318-to-release-1.27

[release-1.27] cleanup: remove secret print in error message
  • Loading branch information
andyzhangx authored Jul 14, 2023
2 parents 63e3d4b + ef1f75f commit 3695d9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/azurefile/azurefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,10 @@ func getStorageAccount(secrets map[string]string) (string, string, error) {
}

if accountName == "" {
return "", "", fmt.Errorf("could not find accountname or azurestorageaccountname field secrets(%v)", secrets)
return "", "", fmt.Errorf("could not find accountname or azurestorageaccountname field in secrets")
}
if accountKey == "" {
return "", "", fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets(%v)", secrets)
return "", "", fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets")
}
accountName = strings.TrimSpace(accountName)

Expand Down
12 changes: 6 additions & 6 deletions pkg/azurefile/azurefile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,31 +416,31 @@ func TestGetStorageAccount(t *testing.T) {
},
expected1: "",
expected2: "",
expected3: fmt.Errorf("could not find accountname or azurestorageaccountname field secrets(map[accountname: accountkey:])"),
expected3: fmt.Errorf("could not find accountname or azurestorageaccountname field in secrets"),
},
{
options: emptyAccountKeyMap,
expected1: "",
expected2: "",
expected3: fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets(%v)", emptyAccountKeyMap),
expected3: fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets"),
},
{
options: emptyAccountNameMap,
expected1: "",
expected2: "",
expected3: fmt.Errorf("could not find accountname or azurestorageaccountname field secrets(%v)", emptyAccountNameMap),
expected3: fmt.Errorf("could not find accountname or azurestorageaccountname field secrets"),
},
{
options: emptyAzureAccountKeyMap,
expected1: "",
expected2: "",
expected3: fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets(%v)", emptyAzureAccountKeyMap),
expected3: fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets"),
},
{
options: emptyAzureAccountNameMap,
expected1: "",
expected2: "",
expected3: fmt.Errorf("could not find accountname or azurestorageaccountname field secrets(%v)", emptyAzureAccountNameMap),
expected3: fmt.Errorf("could not find accountname or azurestorageaccountname field in secrets"),
},
{
options: nil,
Expand Down Expand Up @@ -916,7 +916,7 @@ func TestGetFileShareQuota(t *testing.T) {
mockedFileShareResp: storage.FileShare{},
mockedFileShareErr: nil,
expectedQuota: -1,
expectedError: fmt.Errorf("could not find accountname or azurestorageaccountname field secrets(map[secrets:secrets])"),
expectedError: fmt.Errorf("could not find accountname or azurestorageaccountname field in secrets"),
},
{
desc: "Error creating azure client",
Expand Down

0 comments on commit 3695d9f

Please # to comment.