mirror of https://github.com/k3s-io/k3s
Optimize provisioner plugin result check logic
If err is not returned by findProvisionablePlugin(...), storageClass is certainly not nilpull/6/head
parent
95a6f108bd
commit
51e2336476
|
@ -1259,7 +1259,6 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
|
|||
return
|
||||
}
|
||||
|
||||
if storageClass != nil {
|
||||
// Add provisioner annotation so external provisioners know when to start
|
||||
newClaim, err := ctrl.setClaimProvisioner(claim, storageClass)
|
||||
if err != nil {
|
||||
|
@ -1268,19 +1267,14 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
|
|||
return
|
||||
}
|
||||
claim = newClaim
|
||||
}
|
||||
|
||||
if plugin == nil {
|
||||
// findProvisionablePlugin returned no error nor plugin.
|
||||
// This means that an unknown provisioner is requested. Report an event
|
||||
// and wait for the external provisioner
|
||||
if storageClass != nil {
|
||||
msg := fmt.Sprintf("waiting for a volume to be created, either by external provisioner %q or manually created by system administrator", storageClass.Provisioner)
|
||||
ctrl.eventRecorder.Event(claim, v1.EventTypeNormal, "ExternalProvisioning", msg)
|
||||
glog.V(3).Infof("provisioning claim %q: %s", claimToClaimKey(claim), msg)
|
||||
} else {
|
||||
glog.V(3).Infof("cannot find storage class for claim %q", claimToClaimKey(claim))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue