gc

package
v5.2.0-beta1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrImageNotFound -
	ErrImageNotFound = goerrors.New("image not found")
)

Functions

func GetFsStats

func GetFsStats(path string) (*disk.UsageStat, error)

GetFsStats -

Types

type FsStats

type FsStats struct {
	CapacityBytes  uint64 `json:"capacityBytes,omitempty"`
	AvailableBytes uint64 `json:"availableBytes,omitempty"`
}

FsStats -

type ImageGCManager

type ImageGCManager interface {
	// Start async garbage collection of images.
	Start()

	SetServiceImages(seviceImages []string)
}

ImageGCManager is an interface for managing lifecycle of all images. Implementation is thread-safe.

func NewImageGCManager

func NewImageGCManager(dockerClient *client.Client, policy ImageGCPolicy, sandboxImage string) (ImageGCManager, error)

NewImageGCManager instantiates a new ImageGCManager object.

type ImageGCPolicy

type ImageGCPolicy struct {
	// Any usage above this threshold will always trigger garbage collection.
	// This is the highest usage we will allow.
	HighThresholdPercent int

	// Any usage below this threshold will never trigger garbage collection.
	// This is the lowest threshold we will try to garbage collect to.
	LowThresholdPercent int

	// Minimum age at which an image can be garbage collected.
	MinAge time.Duration

	// ImageGCPeriod is the period for performing image garbage collection.
	ImageGCPeriod time.Duration
}

ImageGCPolicy is a policy for garbage collecting images. Policy defines an allowed band in which garbage collection will be run.

Jump to

Keyboard shortcuts

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