rootfs_provider

package
v0.0.0-...-6c5b0a6 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CakeOrdinator

type CakeOrdinator struct {
	// contains filtered or unexported fields
}

CakeOrdinator manages a cake, fetching layers as neccesary

func NewCakeOrdinator

func NewCakeOrdinator(cake layercake.Cake, fetcher RepositoryFetcher, layerCreator LayerCreator, metrics Metricser, gc GCer) *CakeOrdinator

New creates a new cake-ordinator, there should only be one CakeOrdinator for a particular cake.

func Wire

func Wire(
	logger lager.Logger,
	runner *logging.Runner,
	graphRoot string,
	rootFS string,
	dockerRegistry string,
	insecureRegistries []string,
	persistentImages []string,
	cleanupThresholdInMegabytes int,
	uidMappings idmapper.MappingList,
	gidMappings idmapper.MappingList,
) *CakeOrdinator

func (*CakeOrdinator) Create

func (c *CakeOrdinator) Create(logger lager.Logger, id string, spec gardener.RootfsSpec) (specs.Spec, error)

func (*CakeOrdinator) Destroy

func (c *CakeOrdinator) Destroy(logger lager.Logger, id string) error

func (*CakeOrdinator) GC

func (c *CakeOrdinator) GC(logger lager.Logger) error

func (*CakeOrdinator) Metrics

func (c *CakeOrdinator) Metrics(logger lager.Logger, id string, _ bool) (garden.ContainerDiskStat, error)

type ContainerLayerCreator

type ContainerLayerCreator struct {
	// contains filtered or unexported fields
}

func NewLayerCreator

func NewLayerCreator(
	graph Graph,
	volumeCreator VolumeCreator,
	namespacer Namespacer,
) *ContainerLayerCreator

func (*ContainerLayerCreator) Create

func (provider *ContainerLayerCreator) Create(log lager.Logger, id string, parentImage *repository_fetcher.Image, spec gardener.RootfsSpec) (string, []string, error)

type GCer

type GCer interface {
	GC(log lager.Logger, cake layercake.Cake) error
}

type GetUsageFunc

type GetUsageFunc func(logger lager.Logger, rootfsPath string) (garden.ContainerDiskStat, error)

type Graph

type Graph interface {
	layercake.Cake
}

type LayerCreator

type LayerCreator interface {
	Create(log lager.Logger, id string, parentImage *repository_fetcher.Image, spec gardener.RootfsSpec) (string, []string, error)
}

type Mapper

type Mapper interface {
	Map(id int) int
}

type MetricsAdapter

type MetricsAdapter struct {
	// contains filtered or unexported fields
}

MetricsAdapter implements cakeordinator.Metricser using existing quota_manager.GetUsage func

func NewMetricsAdapter

func NewMetricsAdapter(fn GetUsageFunc, id2path func(layercake.ID) string) MetricsAdapter

func (MetricsAdapter) Metrics

type Metricser

type Metricser interface {
	Metrics(logger lager.Logger, id layercake.ID) (garden.ContainerDiskStat, error)
}

type Namespacer

type Namespacer interface {
	CacheKey() string
	Namespace(log lager.Logger, rootfsPath string) error
}

type RepositoryFetcher

type RepositoryFetcher interface {
	Fetch(log lager.Logger, rootfs *url.URL, username, password string, diskQuota int64) (*repository_fetcher.Image, error)
}

type SimpleVolumeCreator

type SimpleVolumeCreator struct{}

SimpleVolumeCreator implements volume creation by (simply) creating the relevant directories. If a directory already exists in the image it is emptied.

func (SimpleVolumeCreator) Create

func (SimpleVolumeCreator) Create(root string, volume string) error

type StringMapper

type StringMapper interface {
	fmt.Stringer
	Mapper
}

type Translator

type Translator interface {
	CacheKey() string
	Translate(path string, info os.FileInfo, err error) error
}

type UidNamespacer

type UidNamespacer struct {
	Translator Translator
}

func (*UidNamespacer) CacheKey

func (n *UidNamespacer) CacheKey() string

func (*UidNamespacer) Namespace

func (n *UidNamespacer) Namespace(log lager.Logger, rootfsPath string) error

type UidTranslator

type UidTranslator struct {
	// contains filtered or unexported fields
}

func NewUidTranslator

func NewUidTranslator(uidMappings StringMapper, gidMappings StringMapper) *UidTranslator

func (UidTranslator) CacheKey

func (u UidTranslator) CacheKey() string

func (UidTranslator) Translate

func (u UidTranslator) Translate(path string, info os.FileInfo, err error) error

type VolumeCreator

type VolumeCreator interface {
	Create(root string, volume string) error
}

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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