Commit c3c2ed8b authored by Jan Safranek's avatar Jan Safranek

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.
parent 6ed20737
......@@ -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
......
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