mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Send VolumeMismatch event to PVC
PV controller should send events to PVCs and not PVs when a PVC requests PV that's either too small or has mismatching StorageClass. Regular users can't see events on PVs so `kubectl describe pvc` is the only way how to tell user that something is wrong.
This commit is contained in:
parent
6ed207374f
commit
c3c2ed8b60
@ -319,7 +319,7 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(claim *v1.PersistentVol
|
||||
if err = checkVolumeSatisfyClaim(volume, claim); err != nil {
|
||||
glog.V(4).Infof("Can't bind the claim to volume %q: %v", volume.Name, err)
|
||||
//send a event
|
||||
ctrl.eventRecorder.Event(volume, v1.EventTypeWarning, events.VolumeMismatch, "Volume's size is smaller than requested or volume's class does not match with claim")
|
||||
ctrl.eventRecorder.Event(claim, v1.EventTypeWarning, events.VolumeMismatch, "Volume's size is smaller than requested or volume's class does not match with claim")
|
||||
//volume does not satisfy the requirements of the claim
|
||||
if _, err = ctrl.updateClaimStatus(claim, v1.ClaimPending, nil); err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user