Commit 51afd82c authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #52296 from gnufied/fix-glusterfs-expand-unit

Automatic merge from submit-queue (batch tested with PRs 51041, 52297, 52296, 52335, 52338) Glusterfs expands in units of GB not GiB When expanding glusterfs volumes, we should use GB units not GiB. More information - https://github.com/heketi/heketi/wiki/API Fixes https://github.com/kubernetes/kubernetes/issues/52298 ```release-note Fixes Glusterfs storage allocation units ```
parents 8e95e39c 77be9123
......@@ -737,7 +737,8 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsVolum
var clusterIDs []string
capacity := p.options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]
volSizeBytes := capacity.Value()
sz := int(volume.RoundUpSize(volSizeBytes, 1024*1024*1024))
// Glusterfs creates volumes in units of GBs
sz := int(volume.RoundUpSize(volSizeBytes, 1000*1000*1000))
glog.V(2).Infof("create volume of size: %d bytes and configuration %+v", volSizeBytes, p.provisionerConfig)
if p.url == "" {
glog.Errorf("REST server endpoint is empty")
......@@ -1080,7 +1081,7 @@ func (plugin *glusterfsPlugin) ExpandVolumeDevice(spec *volume.Spec, newSize res
// Find out delta size
expansionSize := (newSize.Value() - oldSize.Value())
expansionSizeGB := int(volume.RoundUpSize(expansionSize, 1024*1024*1024))
expansionSizeGB := int(volume.RoundUpSize(expansionSize, 1000*1000*1000))
// Make volume expansion request
volumeExpandReq := &gapi.VolumeExpandRequest{Size: expansionSizeGB}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment