Skip to content

Commit

Permalink
fix snapshot size
Browse files Browse the repository at this point in the history
  • Loading branch information
umagnus committed Aug 7, 2024
1 parent a9de53a commit e58aa6e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/azurefile/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,14 @@ func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequ
itemSnapshotQuota = pointer.Int32Deref(snapshotShare.ShareQuota, 0)
}

klog.V(2).Infof("Created share snapshot: %s", itemSnapshot)
klog.V(2).Infof("created share snapshot: %s, time: %v, quota: %dGiB", itemSnapshot, itemSnapshotTime, itemSnapshotQuota)
if itemSnapshotQuota == 0 {
fileshare, err := d.cloud.FileClient.WithSubscriptionID(subsID).GetFileShare(ctx, rgName, accountName, fileShareName, "")
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get file share(%s) quota: %v", fileShareName, err)
}
itemSnapshotQuota = pointer.Int32Deref(fileshare.ShareQuota, defaultAzureFileQuota)
}
createResp := &csi.CreateSnapshotResponse{
Snapshot: &csi.Snapshot{
SizeBytes: volumehelper.GiBToBytes(int64(itemSnapshotQuota)),
Expand Down

0 comments on commit e58aa6e

Please # to comment.