Commit 77be9123 authored by Hemant Kumar's avatar Hemant Kumar

Fix glusterfs creating volumes in GiB

As per glusterfs documentation it can't create volumes in GiB and all sizes must be specified in GB. This code was slightly buggy because we were creating volumes of sizes lesser than user asked for
parent 7e8b4a2d
...@@ -737,7 +737,8 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsVolum ...@@ -737,7 +737,8 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsVolum
var clusterIDs []string var clusterIDs []string
capacity := p.options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] capacity := p.options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]
volSizeBytes := capacity.Value() 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) glog.V(2).Infof("create volume of size: %d bytes and configuration %+v", volSizeBytes, p.provisionerConfig)
if p.url == "" { if p.url == "" {
glog.Errorf("REST server endpoint is empty") glog.Errorf("REST server endpoint is empty")
......
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