Prevent pv controller from forcefully overwrite provisioned volume name
This fix prevents the PV controller from forcefully overwriting the provisioned volume's name with the generated PV name. Instead, it allows dynamic provisioner implementers to set the name of the volume to a value that they choose.
This commit is contained in:
@@ -1329,7 +1329,9 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
|
||||
glog.V(3).Infof("volume %q for claim %q created", volume.Name, claimToClaimKey(claim))
|
||||
|
||||
// Create Kubernetes PV object for the volume.
|
||||
volume.Name = pvName
|
||||
if volume.Name == "" {
|
||||
volume.Name = pvName
|
||||
}
|
||||
// Bind it to the claim
|
||||
volume.Spec.ClaimRef = claimRef
|
||||
volume.Status.Phase = v1.VolumeBound
|
||||
|
Reference in New Issue
Block a user