container

package
v0.0.0-...-56d4ad1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Get(types.UID) (*PodStatus, error)
	// Set updates the cache by setting the PodStatus for the pod only
	// if the data is newer than the cache based on the provided
	// time stamp. Returns if the cache was updated.
	Set(types.UID, *PodStatus, error, time.Time) (updated bool)
	// GetNewerThan is a blocking call that only returns the status
	// when it is newer than the given time.
	GetNewerThan(types.UID, time.Time) (*PodStatus, error)
	Delete(types.UID)
	UpdateTime(time.Time)
}

Cache stores the PodStatus for the pods. It represents *all* the visible pods/containers in the container runtime. All cache entries are at least as new or newer than the global timestamp (set by UpdateTime()), while individual entries may be slightly newer than the global timestamp. If a pod has no states known by the runtime, Cache returns an empty PodStatus object with ID populated.

Cache provides two methods to retrieve the PodStatus: the non-blocking Get() and the blocking GetNewerThan() method. The component responsible for populating the cache is expected to call Delete() to explicitly free the cache entries.

func NewCache

func NewCache() Cache

NewCache creates a pod cache.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL