imageplugin

package
v0.0.0-...-69732fb Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ImageSpecSchemaVersion              = 2
	ImageSpecBaseDirectoryAnnotationKey = "org.cloudfoundry.experimental.image.base-directory"
)
View Source
const PreloadedPlusLayerScheme = "preloaded+layer"

Variables

This section is empty.

Functions

func GenerateImageConfig

func GenerateImageConfig(layerSHAs ...string) imagespec.Image

func GenerateIndex

func GenerateIndex(manifestSHA string) imagespec.Index

func GenerateManifest

func GenerateManifest(layers []Layer, configSHA string) imagespec.Manifest

Types

type CommandCreator

type CommandCreator interface {
	CreateCommand(log lager.Logger, handle string, spec gardener.RootfsSpec) (*exec.Cmd, error)
	DestroyCommand(log lager.Logger, handle string) *exec.Cmd
	MetricsCommand(log lager.Logger, handle string) *exec.Cmd
	CapacityCommand(log lager.Logger) *exec.Cmd
}

type DefaultCommandCreator

type DefaultCommandCreator struct {
	BinPath   string
	ExtraArgs []string
}

func (*DefaultCommandCreator) CapacityCommand

func (cc *DefaultCommandCreator) CapacityCommand(log lager.Logger) *exec.Cmd

func (*DefaultCommandCreator) CreateCommand

func (cc *DefaultCommandCreator) CreateCommand(log lager.Logger, handle string, spec gardener.RootfsSpec) (*exec.Cmd, error)

func (*DefaultCommandCreator) DestroyCommand

func (cc *DefaultCommandCreator) DestroyCommand(log lager.Logger, handle string) *exec.Cmd

func (*DefaultCommandCreator) MetricsCommand

func (cc *DefaultCommandCreator) MetricsCommand(log lager.Logger, handle string) *exec.Cmd

type ImagePlugin

type ImagePlugin struct {
	UnprivilegedCommandCreator CommandCreator
	PrivilegedCommandCreator   CommandCreator
	ImageSpecCreator           ImageSpecCreator
	CommandRunner              commandrunner.CommandRunner
	DefaultRootfs              string
}

func (*ImagePlugin) Capacity

func (p *ImagePlugin) Capacity(log lager.Logger) (uint64, error)

func (*ImagePlugin) Create

func (p *ImagePlugin) Create(log lager.Logger, handle string, spec gardener.RootfsSpec) (specs.Spec, error)

func (*ImagePlugin) Destroy

func (p *ImagePlugin) Destroy(log lager.Logger, handle string) error

func (*ImagePlugin) GC

func (p *ImagePlugin) GC(log lager.Logger) error

func (*ImagePlugin) Metrics

func (p *ImagePlugin) Metrics(log lager.Logger, handle string, namespaced bool) (garden.ContainerDiskStat, error)

type ImageSpecCreator

type ImageSpecCreator interface {
	CreateImageSpec(rootFS *url.URL, handle string) (*url.URL, error)
}

type Layer

type Layer struct {
	URL       string
	SHA256    string
	BaseDir   string
	MediaType string
}

type Logger

type Logger interface {
	Debug(action string, data ...lager.Data)
	Info(action string, data ...lager.Data)
	Error(action string, err error, data ...lager.Data)
}

type NotImplementedCommandCreator

type NotImplementedCommandCreator struct {
	Err error
}

func (*NotImplementedCommandCreator) CapacityCommand

func (cc *NotImplementedCommandCreator) CapacityCommand(log lager.Logger) *exec.Cmd

func (*NotImplementedCommandCreator) CreateCommand

func (cc *NotImplementedCommandCreator) CreateCommand(log lager.Logger, handle string, spec gardener.RootfsSpec) (*exec.Cmd, error)

func (*NotImplementedCommandCreator) DestroyCommand

func (cc *NotImplementedCommandCreator) DestroyCommand(log lager.Logger, handle string) *exec.Cmd

func (*NotImplementedCommandCreator) MetricsCommand

func (cc *NotImplementedCommandCreator) MetricsCommand(log lager.Logger, handle string) *exec.Cmd

type OCIImageSpecCreator

type OCIImageSpecCreator struct {
	DepotDir             string
	ImageConfigGenerator func(layerSHAs ...string) imagespec.Image
	ManifestGenerator    func(layers []Layer, configSHA string) imagespec.Manifest
	IndexGenerator       func(manifestSHA string) imagespec.Index
}

func NewOCIImageSpecCreator

func NewOCIImageSpecCreator(depotDir string) *OCIImageSpecCreator

func (*OCIImageSpecCreator) CreateImageSpec

func (o *OCIImageSpecCreator) CreateImageSpec(rootFS *url.URL, handle string) (*url.URL, error)

type Relogger

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

func NewRelogger

func NewRelogger(destination Logger) Relogger

func (Relogger) Write

func (r Relogger) Write(data []byte) (n int, err error)

Directories

Path Synopsis
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