From 77be9123f7f38ffb3a0a4ae79f698e49ffff56a6 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Mon, 11 Sep 2017 16:25:28 -0400 Subject: [PATCH] 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 --- pkg/volume/glusterfs/glusterfs.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index af73b27f23c..d1476d8f099 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -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")