mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
store volume size in bytes in configmap
during volume creation we check volume size in bytes, and even during listing of volumes and snapshots we need to check size in bytes Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
bd8cf1d7f0
commit
dd41295900
@ -181,6 +181,9 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// store volume size in bytes (snapshot and check existing volume needs volume
|
||||
// size in bytes)
|
||||
rbdVol.VolSize = rbdVol.VolSize * util.MiB
|
||||
|
||||
rbdVolumes[rbdVol.VolID] = rbdVol
|
||||
|
||||
@ -191,7 +194,7 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
|
||||
return &csi.CreateVolumeResponse{
|
||||
Volume: &csi.Volume{
|
||||
VolumeId: rbdVol.VolID,
|
||||
CapacityBytes: rbdVol.VolSize * util.MiB,
|
||||
CapacityBytes: rbdVol.VolSize,
|
||||
VolumeContext: req.GetParameters(),
|
||||
},
|
||||
}, nil
|
||||
|
Loading…
Reference in New Issue
Block a user