In case storage class parameters are empty, create a new map for Portworx volume labels

Fixes #64894

Signed-off-by: Harsh Desai <harsh@portworx.com>
pull/8/head
Harsh Desai 2018-06-07 13:47:24 -07:00
parent 16921ae7a8
commit b5234d33dd
1 changed files with 7 additions and 2 deletions

View File

@ -71,8 +71,13 @@ func (util *PortworxVolumeUtil) CreateVolume(p *portworxVolumeProvisioner) (stri
spec = specHandler.DefaultSpec()
}
// Pass all parameters as volume labels for Portworx server-side processing.
spec.VolumeLabels = p.options.Parameters
// Pass all parameters as volume labels for Portworx server-side processing
if len(p.options.Parameters) > 0 {
spec.VolumeLabels = p.options.Parameters
} else {
spec.VolumeLabels = make(map[string]string, 0)
}
// Update the requested size in the spec
spec.Size = uint64(requestGiB * volutil.GIB)