Unverified Commit d424bedc authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #76341 from harsh-px/fix-concurrent-access-master

Fix concurrent map write access in Portworx create volume call
parents ed77b963 17dd5989
...@@ -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