PV binding: send an event when there are no PVs to bind

This is similar to scheduler that says "no nodes available to schedule pods"
when it can't schedule a pod.
This commit is contained in:
Jan Safranek
2017-02-02 13:30:53 +01:00
parent 0477100f98
commit 13546e5ea4
2 changed files with 9 additions and 4 deletions

View File

@@ -251,6 +251,7 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(claim *v1.PersistentVol
}
// Mark the claim as Pending and try to find a match in the next
// periodic syncClaim
ctrl.eventRecorder.Event(claim, v1.EventTypeNormal, "FailedBinding", "no persistent volumes available for this claim and no storage class is set")
if _, err = ctrl.updateClaimStatus(claim, v1.ClaimPending, nil); err != nil {
return err
}