kubelet: record an event with a clear reason on host port conflict

Currently, kubelet silently ignores pods that caused host port conflict. This
commit surfaces the error by recording an event.

It also makes sure that kubelet iterates through the pods in the order of the
creation timestamp, which ensures that pods created later are ignored on
conflict.
This commit is contained in:
Yu-Ju Hong
2015-02-27 13:43:21 -08:00
parent d98b081cf8
commit 241df2d3be
3 changed files with 60 additions and 0 deletions

View File

@@ -44,6 +44,11 @@ func Now() Time {
return Time{time.Now()}
}
// Before reports whether the time instant t is before u.
func (t Time) Before(u Time) bool {
return t.Time.Before(u.Time)
}
// Unix returns the local time corresponding to the given Unix time
// by wrapping time.Unix.
func Unix(sec int64, nsec int64) Time {