diff --git a/pkg/kubelet/pleg/generic.go b/pkg/kubelet/pleg/generic.go index de5ee494230..956ef60afc3 100644 --- a/pkg/kubelet/pleg/generic.go +++ b/pkg/kubelet/pleg/generic.go @@ -317,7 +317,10 @@ func (g *GenericPLEG) Relist() { completedConditions = append(completedConditions, condition) } } - g.completeWatchConditions(pid, completedConditions) + if len(completedConditions) > 0 { + g.completeWatchConditions(pid, completedConditions) + events = append(events, &PodLifecycleEvent{ID: pid, Type: ConditionMet}) + } // Update the internal storage and send out the events. g.podRecords.update(pid) diff --git a/pkg/kubelet/pleg/pleg.go b/pkg/kubelet/pleg/pleg.go index 17e7ec81543..08625aba9cc 100644 --- a/pkg/kubelet/pleg/pleg.go +++ b/pkg/kubelet/pleg/pleg.go @@ -47,6 +47,8 @@ const ( PodSync PodLifeCycleEventType = "PodSync" // ContainerChanged - event type when the new state of container is unknown. ContainerChanged PodLifeCycleEventType = "ContainerChanged" + // ConditionMet - event type triggered when any number of watch conditions are met. + ConditionMet PodLifeCycleEventType = "ConditionMet" ) // PodLifecycleEvent is an event that reflects the change of the pod state.