From c3c2ed8b60565ea0b980c6506be3d943022d9cfe Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Mon, 2 Oct 2017 12:21:42 +0200 Subject: [PATCH] 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. --- pkg/controller/volume/persistentvolume/pv_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/volume/persistentvolume/pv_controller.go b/pkg/controller/volume/persistentvolume/pv_controller.go index 58ad88cdfa1..3c6b60fb650 100644 --- a/pkg/controller/volume/persistentvolume/pv_controller.go +++ b/pkg/controller/volume/persistentvolume/pv_controller.go @@ -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