Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38f0908

Browse files
committed
make funcs in azure cloud provider as public
1 parent 79ce30c commit 38f0908

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

pkg/cloudprovider/providers/azure/azure_blobDiskController.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (c *BlobDiskController) initStorageAccounts() {
8282
// If no storage account is given, search all the storage accounts associated with the resource group and pick one that
8383
// fits storage type and location.
8484
func (c *BlobDiskController) CreateVolume(blobName, accountName, accountType, location string, requestGB int) (string, string, int, error) {
85-
account, key, err := c.common.cloud.ensureStorageAccount(accountName, accountType, string(defaultStorageAccountKind), c.common.resourceGroup, location, dedicatedDiskAccountNamePrefix)
85+
account, key, err := c.common.cloud.EnsureStorageAccount(accountName, accountType, string(defaultStorageAccountKind), c.common.resourceGroup, location, dedicatedDiskAccountNamePrefix)
8686
if err != nil {
8787
return "", "", 0, fmt.Errorf("could not get storage key for storage account %s: %v", accountName, err)
8888
}

pkg/cloudprovider/providers/azure/azure_managedDiskController.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (c *ManagedDiskController) CreateManagedDisk(options *ManagedDiskOptions) (
151151
diskID := ""
152152

153153
err = kwait.ExponentialBackoff(defaultBackOff, func() (bool, error) {
154-
provisionState, id, err := c.getDisk(options.ResourceGroup, options.DiskName)
154+
provisionState, id, err := c.GetDisk(options.ResourceGroup, options.DiskName)
155155
diskID = id
156156
// We are waiting for provisioningState==Succeeded
157157
// We don't want to hand-off managed disks to k8s while they are
@@ -197,8 +197,8 @@ func (c *ManagedDiskController) DeleteManagedDisk(diskURI string) error {
197197
return nil
198198
}
199199

200-
// return: disk provisionState, diskID, error
201-
func (c *ManagedDiskController) getDisk(resourceGroup, diskName string) (string, string, error) {
200+
// GetDisk return: disk provisionState, diskID, error
201+
func (c *ManagedDiskController) GetDisk(resourceGroup, diskName string) (string, string, error) {
202202
ctx, cancel := getContextWithCancel()
203203
defer cancel()
204204

pkg/cloudprovider/providers/azure/azure_storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (az *Cloud) CreateFileShare(shareName, accountName, accountType, accountKin
3838
resourceGroup = az.resourceGroup
3939
}
4040

41-
account, key, err := az.ensureStorageAccount(accountName, accountType, accountKind, resourceGroup, location, fileShareAccountNamePrefix)
41+
account, key, err := az.EnsureStorageAccount(accountName, accountType, accountKind, resourceGroup, location, fileShareAccountNamePrefix)
4242
if err != nil {
4343
return "", "", fmt.Errorf("could not get storage key for storage account %s: %v", accountName, err)
4444
}

pkg/cloudprovider/providers/azure/azure_storageaccount.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ func (az *Cloud) GetStorageAccesskey(account, resourceGroup string) (string, err
8989
return "", fmt.Errorf("no valid keys")
9090
}
9191

92-
// ensureStorageAccount search storage account, create one storage account(with genAccountNamePrefix) if not found, return accountName, accountKey
93-
func (az *Cloud) ensureStorageAccount(accountName, accountType, accountKind, resourceGroup, location, genAccountNamePrefix string) (string, string, error) {
92+
// EnsureStorageAccount search storage account, create one storage account(with genAccountNamePrefix) if not found, return accountName, accountKey
93+
func (az *Cloud) EnsureStorageAccount(accountName, accountType, accountKind, resourceGroup, location, genAccountNamePrefix string) (string, string, error) {
9494
if len(accountName) == 0 {
9595
// find a storage account that matches accountType
9696
accounts, err := az.getStorageAccounts(accountType, accountKind, resourceGroup, location)

0 commit comments

Comments
 (0)