Commit 17dd5989 authored by Harsh Desai's avatar Harsh Desai

Fix concurrent map access in Portworx create volume call

Fixes #76340 Signed-off-by: 's avatarHarsh Desai <harsh@portworx.com>
parent 454666bc
...@@ -72,12 +72,14 @@ func (util *portworxVolumeUtil) CreateVolume(p *portworxVolumeProvisioner) (stri ...@@ -72,12 +72,14 @@ func (util *portworxVolumeUtil) CreateVolume(p *portworxVolumeProvisioner) (stri
} }
// Pass all parameters as volume labels for Portworx server-side processing // Pass all parameters as volume labels for Portworx server-side processing
if len(p.options.Parameters) > 0 { if spec.VolumeLabels == nil {
spec.VolumeLabels = p.options.Parameters
} else {
spec.VolumeLabels = make(map[string]string, 0) spec.VolumeLabels = make(map[string]string, 0)
} }
for k, v := range p.options.Parameters {
spec.VolumeLabels[k] = v
}
// Update the requested size in the spec // Update the requested size in the spec
spec.Size = uint64(requestGiB * volumehelpers.GiB) spec.Size = uint64(requestGiB * volumehelpers.GiB)
......
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