mirror of https://github.com/k3s-io/k3s
Merge pull request #71691 from andyzhangx/make-func-public
make GetStorageAccesskey func publicpull/564/head
commit
85b0f58378
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue