chore: switch to use AzureFile management SDK

Signed-off-by: ZeroMagic <jiliu8@microsoft.com>
This commit is contained in:
ZeroMagic
2020-04-21 15:43:26 +00:00
parent 329ecaa657
commit f3a64e22d9
10 changed files with 176 additions and 124 deletions

View File

@@ -165,7 +165,7 @@ func (plugin *azureFilePlugin) ExpandVolumeDevice(
return oldSize, fmt.Errorf("invalid PV spec")
}
shareName := spec.PersistentVolume.Spec.AzureFile.ShareName
azure, err := getAzureCloudProvider(plugin.host.GetCloudProvider())
azure, resourceGroup, err := getAzureCloudProvider(plugin.host.GetCloudProvider())
if err != nil {
return oldSize, err
}
@@ -175,12 +175,12 @@ func (plugin *azureFilePlugin) ExpandVolumeDevice(
return oldSize, err
}
accountName, accountKey, err := (&azureSvc{}).GetAzureCredentials(plugin.host, secretNamespace, secretName)
accountName, _, err := (&azureSvc{}).GetAzureCredentials(plugin.host, secretNamespace, secretName)
if err != nil {
return oldSize, err
}
if err := azure.ResizeFileShare(accountName, accountKey, shareName, int(volumehelpers.RoundUpToGiB(newSize))); err != nil {
if err := azure.ResizeFileShare(resourceGroup, accountName, shareName, int(volumehelpers.RoundUpToGiB(newSize))); err != nil {
return oldSize, err
}