kubernetes/pkg/kubelet/images/image_gc_manager.go

const instrumentationScope

const imageIndexTupleFormat

const ImageGarbageCollectedTotalReasonAge

const ImageGarbageCollectedTotalReasonSpace

type StatsProvider

type ImageGCManager

type ImageGCPolicy

type realImageGCManager

type imageCache

// set sorts the input list and updates image cache.
// 'i' takes ownership of the list, you should not reference the list again
// after calling this function.
func (i *imageCache) set(images []container.Image) {}

// get gets image list from image cache.
// NOTE: The caller of get() should not do mutating operations on the
// returned list that could cause data race against other readers (e.g.
// in-place sorting the returned list)
func (i *imageCache) get() []container.Image {}

type imageRecord

// NewImageGCManager instantiates a new ImageGCManager object.
func NewImageGCManager(runtime container.Runtime, statsProvider StatsProvider, recorder record.EventRecorder, nodeRef *v1.ObjectReference, policy ImageGCPolicy, tracerProvider trace.TracerProvider) (ImageGCManager, error) {}

func (im *realImageGCManager) Start() {}

// Get a list of images on this node
func (im *realImageGCManager) GetImageList() ([]container.Image, error) {}

func (im *realImageGCManager) detectImages(ctx context.Context, detectTime time.Time) (sets.Set[string], error) {}

// handleImageVolumes ensures that image volumes are considered as images in use.
func (im *realImageGCManager) handleImageVolumes(ctx context.Context, imagesInUse sets.Set[string], container *container.Container, pod *container.Pod, images []container.Image) error {}

func (im *realImageGCManager) GarbageCollect(ctx context.Context, beganGC time.Time) error {}

func (im *realImageGCManager) freeOldImages(ctx context.Context, images []evictionInfo, freeTime, beganGC time.Time) ([]evictionInfo, error) {}

func (im *realImageGCManager) DeleteUnusedImages(ctx context.Context) error {}

// Tries to free bytesToFree worth of images on the disk.
//
// Returns the number of bytes free and an error if any occurred. The number of
// bytes freed is always returned.
// Note that error may be nil and the number of bytes free may be less
// than bytesToFree.
func (im *realImageGCManager) freeSpace(ctx context.Context, bytesToFree int64, freeTime time.Time, images []evictionInfo) (int64, error) {}

func (im *realImageGCManager) freeImage(ctx context.Context, image evictionInfo, reason string) error {}

// Queries all of the image records and arranges them in a slice of evictionInfo, sorted based on last time used, ignoring images pinned by the runtime.
func (im *realImageGCManager) imagesInEvictionOrder(ctx context.Context, freeTime time.Time) ([]evictionInfo, error) {}

// If RuntimeClassInImageCriAPI feature gate is enabled, imageRecords
// are identified by a tuple of (imageId,runtimeHandler) that is passed
// from ListImages() call. If no runtimehandler is specified in response
// to ListImages() by the container runtime, only imageID will be will
// be returned.
func getImageTuple(imageID, runtimeHandler string) string {}

// get imageID from the imageTuple
func getImageIDFromTuple(image string) string {}

type evictionInfo

type byLastUsedAndDetected

func (ev byLastUsedAndDetected) Len() int      {}

func (ev byLastUsedAndDetected) Swap(i, j int) {}

func (ev byLastUsedAndDetected) Less(i, j int) bool {}

func isImageUsed(imageID string, imagesInUse sets.Set[string]) bool {}