kubernetes/pkg/kubelet/pleg/generic.go

type GenericPLEG

type plegContainerState

const plegContainerRunning

const plegContainerExited

const plegContainerUnknown

const plegContainerNonExistent

func convertState(state kubecontainer.State) plegContainerState {}

type podRecord

type podRecords

// NewGenericPLEG instantiates a new GenericPLEG object and return it.
func NewGenericPLEG(logger klog.Logger, runtime kubecontainer.Runtime, eventChannel chan *PodLifecycleEvent,
	relistDuration *RelistDuration, cache kubecontainer.Cache,
	clock clock.Clock) PodLifecycleEventGenerator {}

// Watch returns a channel from which the subscriber can receive PodLifecycleEvent
// events.
// TODO: support multiple subscribers.
func (g *GenericPLEG) Watch() chan *PodLifecycleEvent {}

// Start spawns a goroutine to relist periodically.
func (g *GenericPLEG) Start() {}

func (g *GenericPLEG) Stop() {}

func (g *GenericPLEG) Update(relistDuration *RelistDuration) {}

// Healthy check if PLEG work properly.
// relistThreshold is the maximum interval between two relist.
func (g *GenericPLEG) Healthy() (bool, error) {}

func generateEvents(logger klog.Logger, podID types.UID, cid string, oldState, newState plegContainerState) []*PodLifecycleEvent {}

func (g *GenericPLEG) getRelistTime() time.Time {}

func (g *GenericPLEG) updateRelistTime(timestamp time.Time) {}

// Relist queries the container runtime for list of pods/containers, compare
// with the internal pods/containers, and generates events accordingly.
func (g *GenericPLEG) Relist() {}

func getContainersFromPods(pods ...*kubecontainer.Pod) []*kubecontainer.Container {}

func computeEvents(logger klog.Logger, oldPod, newPod *kubecontainer.Pod, cid *kubecontainer.ContainerID) []*PodLifecycleEvent {}

func (g *GenericPLEG) cacheEnabled() bool {}

// getPodIP preserves an older cached status' pod IP if the new status has no pod IPs
// and its sandboxes have exited
func (g *GenericPLEG) getPodIPs(pid types.UID, status *kubecontainer.PodStatus) []string {}

// updateCache tries to update the pod status in the kubelet cache and returns true if the
// pod status was actually updated in the cache. It will return false if the pod status
// was ignored by the cache.
func (g *GenericPLEG) updateCache(ctx context.Context, pod *kubecontainer.Pod, pid types.UID) (error, bool) {}

func (g *GenericPLEG) UpdateCache(pod *kubecontainer.Pod, pid types.UID) (error, bool) {}

func updateEvents(eventsByPodID map[types.UID][]*PodLifecycleEvent, e *PodLifecycleEvent) {}

func getContainerState(pod *kubecontainer.Pod, cid *kubecontainer.ContainerID) plegContainerState {}

func updateRunningPodAndContainerMetrics(pods []*kubecontainer.Pod) {}

func (pr podRecords) getOld(id types.UID) *kubecontainer.Pod {}

func (pr podRecords) getCurrent(id types.UID) *kubecontainer.Pod {}

func (pr podRecords) setCurrent(pods []*kubecontainer.Pod) {}

func (pr podRecords) update(id types.UID) {}

func (pr podRecords) updateInternal(id types.UID, r *podRecord) {}