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
pull/6/head
Hemant Kumar 2017-09-11 16:25:28 -04:00
parent 7e8b4a2d60
commit 77be9123f7
1 changed files with 2 additions and 1 deletions

View File

@ -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")