Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/blob/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,10 @@ func getStorageAccount(secrets map[string]string) (string, string, error) {
}

if accountName == "" {
return accountName, accountKey, fmt.Errorf("could not find %s or %s field secrets(%v)", accountNameField, defaultSecretAccountName, secrets)
return accountName, accountKey, fmt.Errorf("could not find %s or %s field in secrets", accountNameField, defaultSecretAccountName)
}
if accountKey == "" {
return accountName, accountKey, fmt.Errorf("could not find %s or %s field in secrets(%v)", accountKeyField, defaultSecretAccountKey, secrets)
return accountName, accountKey, fmt.Errorf("could not find %s or %s field in secrets", accountKeyField, defaultSecretAccountKey)
}

accountName = strings.TrimSpace(accountName)
Expand Down
18 changes: 7 additions & 11 deletions pkg/blob/blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -840,31 +840,31 @@ func TestGetStorageAccount(t *testing.T) {
},
expectedAccountName: "",
expectedAccountKey: "",
expectedError: fmt.Errorf("could not find accountname or azurestorageaccountname field secrets(map[accountname: accountkey:])"),
expectedError: fmt.Errorf("could not find accountname or azurestorageaccountname field"),
},
{
options: emptyAccountKeyMap,
expectedAccountName: "testaccount",
expectedAccountKey: "",
expectedError: fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets(%v)", emptyAccountKeyMap),
expectedError: fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets"),
},
{
options: emptyAccountNameMap,
expectedAccountName: "",
expectedAccountKey: "testkey",
expectedError: fmt.Errorf("could not find accountname or azurestorageaccountname field secrets(%v)", emptyAccountNameMap),
expectedError: fmt.Errorf("could not find accountname or azurestorageaccountname field in secrets"),
},
{
options: emptyAzureAccountKeyMap,
expectedAccountName: "testaccount",
expectedAccountKey: "",
expectedError: fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets(%v)", emptyAzureAccountKeyMap),
expectedError: fmt.Errorf("could not find accountkey or azurestorageaccountkey field in secrets"),
},
{
options: emptyAzureAccountNameMap,
expectedAccountName: "",
expectedAccountKey: "testkey",
expectedError: fmt.Errorf("could not find accountname or azurestorageaccountname field secrets(%v)", emptyAzureAccountNameMap),
expectedError: fmt.Errorf("could not find accountname or azurestorageaccountname field in secrets"),
},
{
options: nil,
Expand Down Expand Up @@ -905,19 +905,15 @@ func TestGetContainerReference(t *testing.T) {
secrets: map[string]string{
"accountKey": fakeAccountKey,
},
expectedError: fmt.Errorf("could not find %s or %s field secrets(%v)", accountNameField, defaultSecretAccountName, map[string]string{
"accountKey": fakeAccountKey,
}),
expectedError: fmt.Errorf("could not find %s or %s field in secrets", accountNameField, defaultSecretAccountName),
},
{
name: "failed to retrieve accountKey",
containerName: fakeContainerName,
secrets: map[string]string{
"accountName": fakeAccountName,
},
expectedError: fmt.Errorf("could not find %s or %s field in secrets(%v)", accountKeyField, defaultSecretAccountKey, map[string]string{
"accountName": fakeAccountName,
}),
expectedError: fmt.Errorf("could not find %s or %s field in secrets", accountKeyField, defaultSecretAccountKey),
},
{
name: "failed to obtain client",
Expand Down