Merge pull request #71691 from andyzhangx/make-func-public

make GetStorageAccesskey func public
pull/564/head
Kubernetes Prow Robot 2018-12-04 04:12:30 -08:00 committed by GitHub
commit 85b0f58378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -108,7 +108,7 @@ func (c *BlobDiskController) DeleteVolume(diskURI string) error {
if err != nil {
return fmt.Errorf("failed to parse vhd URI %v", err)
}
key, err := c.common.cloud.getStorageAccesskey(accountName, c.common.resourceGroup)
key, err := c.common.cloud.GetStorageAccesskey(accountName, c.common.resourceGroup)
if err != nil {
return fmt.Errorf("no key for storage account %s, err %v", accountName, err)
}

View File

@ -64,8 +64,8 @@ func (az *Cloud) getStorageAccounts(matchingAccountType, matchingAccountKind, re
return accounts, nil
}
// getStorageAccesskey gets the storage account access key
func (az *Cloud) getStorageAccesskey(account, resourceGroup string) (string, error) {
// GetStorageAccesskey gets the storage account access key
func (az *Cloud) GetStorageAccesskey(account, resourceGroup string) (string, error) {
ctx, cancel := getContextWithCancel()
defer cancel()
@ -137,7 +137,7 @@ func (az *Cloud) ensureStorageAccount(accountName, accountType, accountKind, res
}
// find the access key with this account
accountKey, err := az.getStorageAccesskey(accountName, resourceGroup)
accountKey, err := az.GetStorageAccesskey(accountName, resourceGroup)
if err != nil {
return "", "", fmt.Errorf("could not get storage key for storage account %s: %v", accountName, err)
}

View File

@ -64,7 +64,7 @@ func TestGetStorageAccessKeys(t *testing.T) {
expectedKey := test.expectedKey
fake.Keys = test.results
fake.Err = test.err
key, err := cloud.getStorageAccesskey("acct", "rg")
key, err := cloud.GetStorageAccesskey("acct", "rg")
if test.expectErr && err == nil {
t.Errorf("Unexpected non-error")
continue