Documentation

Index

Constants

View Source
const (
	GlobalLockKey                      = "global-groot-lock"
	MetricImageCreationTime            = "ImageCreationTime"
	MetricImageDeletionTime            = "ImageDeletionTime"
	MetricImageStatsTime               = "ImageStatsTime"
	MetricImageCleanTime               = "ImageCleanTime"
	MetricDiskCachePercentage          = "DiskCachePercentage"
	MetricDiskCommittedPercentage      = "DiskCommittedPercentage"
	MetricDiskPurgeableCachePercentage = "DiskPurgeableCachePercentage"
)
View Source
const ImageReferenceFormat = "image:%s"
View Source
const NamespaceFilename = "namespace.json"

Variables

This section is empty.

Functions

func IamCleaner

func IamCleaner(locksmith Locksmith, sm StoreMeasurer,
	gc GarbageCollector, metricsEmitter MetricsEmitter,
) *cleaner

Types

type BaseImage

type BaseImage struct {
	BaseImage specsv1.Image
	ChainIDs  []string
}

type BaseImagePuller

type BaseImagePuller interface {
	Pull(logger lager.Logger, spec BaseImageSpec) (BaseImage, error)
}

type BaseImageSpec

type BaseImageSpec struct {
	DiskLimit                 int64
	ExcludeBaseImageFromQuota bool
	BaseImageSrc              *url.URL
	UIDMappings               []IDMappingSpec
	GIDMappings               []IDMappingSpec
	OwnerUID                  int
	OwnerGID                  int
}

type Cleaner

type Cleaner interface {
	Clean(logger lager.Logger, cacheSize int64) (bool, error)
}

go:generate counterfeiter . Cleaner

type CreateSpec

type CreateSpec struct {
	ID                          string
	BaseImageURL                *url.URL
	DiskLimit                   int64
	Mount                       bool
	ExcludeBaseImageFromQuota   bool
	CleanOnCreate               bool
	CleanOnCreateThresholdBytes int64
	UIDMappings                 []IDMappingSpec
	GIDMappings                 []IDMappingSpec
}

type Creator

type Creator struct {

	// contains filtered or unexported fields

}

func IamCreator

func IamCreator(
	imageCloner ImageCloner, baseImagePuller BaseImagePuller,
	locksmith Locksmith, dependencyManager DependencyManager,
	metricsEmitter MetricsEmitter, cleaner Cleaner) *Creator

func (*Creator) Create

func (c *Creator) Create(logger lager.Logger, spec CreateSpec) (ImageInfo, error)

type Deleter

type Deleter struct {

	// contains filtered or unexported fields

}

func IamDeleter

func IamDeleter(imageCloner ImageCloner, dependencyManager DependencyManager, metricsEmitter MetricsEmitter) *Deleter

func (*Deleter) Delete

func (d *Deleter) Delete(logger lager.Logger, id string) error

type DependencyManager

type DependencyManager interface {
	Register(id string, chainIDs []string) error
	Deregister(id string) error
}

type DiskUsage

type DiskUsage struct {
	TotalBytesUsed     int64 `json:"total_bytes_used"`
	ExclusiveBytesUsed int64 `json:"exclusive_bytes_used"`
}

type GarbageCollector

type GarbageCollector interface {
	UnusedVolumes(logger lager.Logger) ([]string, error)
	MarkUnused(logger lager.Logger, unusedVolumes []string) error
	Collect(logger lager.Logger) error
}

type IDMappingSpec

type IDMappingSpec struct {
	HostID      int
	NamespaceID int
	Size        int
}

type IDMappings

type IDMappings struct {
	UIDMappings []IDMappingSpec
	GIDMappings []IDMappingSpec
}

type ImageCloner

type ImageCloner interface {
	Exists(id string) (bool, error)
	Create(logger lager.Logger, spec ImageSpec) (ImageInfo, error)
	Destroy(logger lager.Logger, id string) error
	Stats(logger lager.Logger, id string) (VolumeStats, error)
}

type ImageInfo

type ImageInfo struct {
	Rootfs string        `json:"rootfs"`
	Image  specsv1.Image `json:"image,omitempty"`
	Mounts []MountInfo   `json:"mounts,omitempty"`
	Path   string        `json:"-"`
}

type ImageSpec

type ImageSpec struct {
	ID                        string
	Mount                     bool
	DiskLimit                 int64
	ExcludeBaseImageFromQuota bool
	BaseVolumeIDs             []string
	BaseImage                 specsv1.Image
	OwnerUID                  int
	OwnerGID                  int
}

type Lister

type Lister struct {
}

func IamLister

func IamLister() *Lister

func (*Lister) List

func (l *Lister) List(logger lager.Logger, storePath string) ([]string, error)

type Locksmith

type Locksmith interface {
	Lock(key string) (*os.File, error)
	Unlock(lockFile *os.File) error
}

type MetricsEmitter

type MetricsEmitter interface {
	TryEmitUsage(logger lager.Logger, name string, usage int64, units string)
	TryEmitDurationFrom(logger lager.Logger, name string, from time.Time)
}

type MountInfo

type MountInfo struct {
	Destination string   `json:"destination"`
	Type        string   `json:"type"`
	Source      string   `json:"source"`
	Options     []string `json:"options"`
}

type RootFSConfigurer

type RootFSConfigurer interface {
	Configure(rootFSPath string, baseImage *specsv1.Image) error
}

type Statser

type Statser struct {

	// contains filtered or unexported fields

}

func IamStatser

func IamStatser(imageCloner ImageCloner, metricsEmitter MetricsEmitter) *Statser

func (*Statser) Stats

func (m *Statser) Stats(logger lager.Logger, id string) (VolumeStats, error)

type StoreMeasurer

type StoreMeasurer interface {
	Usage(logger lager.Logger) (int64, error)
	CacheUsage(logger lager.Logger, volumes []string) int64
}

type StoreNamespacer

type StoreNamespacer struct {
	// contains filtered or unexported fields

}

func NewStoreNamespacer

func NewStoreNamespacer(storePath string) *StoreNamespacer

func (*StoreNamespacer) ApplyMappings

func (n *StoreNamespacer) ApplyMappings(uidMappings, gidMappings []IDMappingSpec) error

func (*StoreNamespacer) Read

func (n *StoreNamespacer) Read() (IDMappings, error)

type VolumeStats

type VolumeStats struct {
	DiskUsage DiskUsage `json:"disk_usage"`
}

Directories

Path Synopsis
grootfakes Code generated by counterfeiter.