add shareName param in azure file storage class

skip create azure file if it exists
This commit is contained in:
andyzhangx
2019-04-22 06:41:45 +00:00
parent 75d45bdfc9
commit ad9d033e50
2 changed files with 16 additions and 7 deletions

View File

@@ -60,9 +60,13 @@ func (f *azureFileClient) createFileShare(accountName, accountKey, name string,
}
share := fileClient.GetShareReference(name)
share.Properties.Quota = sizeGiB
if err = share.Create(nil); err != nil {
newlyCreated, err := share.CreateIfNotExists(nil)
if err != nil {
return fmt.Errorf("failed to create file share, err: %v", err)
}
if !newlyCreated {
klog.V(2).Infof("file share(%s) under account(%s) already exists", name, accountName)
}
return nil
}