mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #46486 from NickrenREN/pv-provisioner-check
Automatic merge from submit-queue Optimize provisioner plugin result check logic If err is not returned by findProvisionablePlugin(...), storageClass is certainly not nil **Release note**: ```release-note NONE ```
This commit is contained in:
commit
c77b74e328
@ -1259,28 +1259,22 @@ 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 {
|
||||
// Save failed, the controller will retry in the next sync
|
||||
glog.V(2).Infof("error saving claim %s: %v", claimToClaimKey(claim), err)
|
||||
return
|
||||
}
|
||||
claim = newClaim
|
||||
// Add provisioner annotation so external provisioners know when to start
|
||||
newClaim, err := ctrl.setClaimProvisioner(claim, storageClass)
|
||||
if err != nil {
|
||||
// Save failed, the controller will retry in the next sync
|
||||
glog.V(2).Infof("error saving claim %s: %v", claimToClaimKey(claim), err)
|
||||
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))
|
||||
}
|
||||
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)
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user