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:
		| @@ -319,7 +319,7 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(claim *v1.PersistentVol | |||||||
| 				if err = checkVolumeSatisfyClaim(volume, claim); err != nil { | 				if err = checkVolumeSatisfyClaim(volume, claim); err != nil { | ||||||
| 					glog.V(4).Infof("Can't bind the claim to volume %q: %v", volume.Name, err) | 					glog.V(4).Infof("Can't bind the claim to volume %q: %v", volume.Name, err) | ||||||
| 					//send a event | 					//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 | 					//volume does not satisfy the requirements of the claim | ||||||
| 					if _, err = ctrl.updateClaimStatus(claim, v1.ClaimPending, nil); err != nil { | 					if _, err = ctrl.updateClaimStatus(claim, v1.ClaimPending, nil); err != nil { | ||||||
| 						return err | 						return err | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jan Safranek
					Jan Safranek