Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions pkg/azurefile/azurefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/klog/v2"
mount "k8s.io/mount-utils"
"k8s.io/utils/ptr"

csicommon "sigs.k8s.io/azurefile-csi-driver/pkg/csi-common"
"sigs.k8s.io/azurefile-csi-driver/pkg/mounter"
Expand Down Expand Up @@ -1032,12 +1033,14 @@ func (d *Driver) ResizeFileShare(ctx context.Context, subsID, resourceGroup, acc
if err != nil {
return true, err
}
if ptr.Deref(fileShare.FileShareProperties.ShareQuota, 0) >= int32(sizeGiB) {
klog.Warningf("file share size(%dGi) is already greater or equal than requested size(%dGi), accountName: %s, shareName: %s",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, if fileShare.FileShareProperties.ShareQuota was nil, then IMO the logging statement below should have also guarded against printing nil pointer. But that is perhaps a minor nit. :/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2433 would fix the issue, thx

fileShare.FileShareProperties.ShareQuota, sizeGiB, accountName, shareName)
return true, nil
}
fileShare.FileShareProperties.ShareQuota = to.Ptr(int32(sizeGiB))
_, err = fileClient.Update(ctx, resourceGroup, accountName, shareName, *fileShare)
if err != nil {
return true, err
}
return true, nil
return true, err
}
if isRetriableError(err) {
klog.Warningf("ResizeFileShare(%s) on account(%s) with new size(%d) failed with error(%v), waiting for retrying", shareName, accountName, sizeGiB, err)
Expand Down
Loading