Commit 22580c50 authored by Harsh Desai's avatar Harsh Desai

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

Fixes #64894 Signed-off-by: 's avatarHarsh Desai <harsh@portworx.com>
parent 1a1c0bab
...@@ -68,8 +68,13 @@ func (util *PortworxVolumeUtil) CreateVolume(p *portworxVolumeProvisioner) (stri ...@@ -68,8 +68,13 @@ func (util *PortworxVolumeUtil) CreateVolume(p *portworxVolumeProvisioner) (stri
spec = specHandler.DefaultSpec() spec = specHandler.DefaultSpec()
} }
// Pass all parameters as volume labels for Portworx server-side processing. // Pass all parameters as volume labels for Portworx server-side processing
spec.VolumeLabels = p.options.Parameters 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 // Update the requested size in the spec
spec.Size = uint64(requestGB * 1024 * 1024 * 1024) spec.Size = uint64(requestGB * 1024 * 1024 * 1024)
// Change the Portworx Volume name to PV name // Change the Portworx Volume name to PV name
......
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