image

package
v1.34.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateExportCommand

func CreateExportCommand(version string, profile string, images []string) (*exec.Cmd, error)

func GetOpenShiftImageNames

func GetOpenShiftImageNames(version string) []string

GetOpenShiftImageNames returns the full images names for the images requires for a fully functioning OpenShift instance

Types

type Annotations added in v1.10.0

type Annotations struct {
	Name string `json:"org.opencontainers.image.ref.name"`
}

type ImageCacheConfig

type ImageCacheConfig struct {
	HostCacheDir      string
	CachedImages      []string
	Out               io.Writer
	ImageMissStrategy ImageMissStrategy
}

type ImageHandler

type ImageHandler interface {
	// ImportImages imports cached images from the host into the Docker daemon of the VM.
	// The method returns the list of successfully imported images and an error if one occurred.
	ImportImages(config *ImageCacheConfig) ([]string, error)

	// ExportImages exports the images specified as part of the ImageCacheConfig from the VM to the host.
	// The method returns the list of successfully exported images and an error if one occurred.
	ExportImages(config *ImageCacheConfig, overwrite bool) ([]string, error)

	// IsImageCached returns true if the specified image is cached, false otherwise.
	IsImageCached(config *ImageCacheConfig, image string) bool

	// AreImagesCached returns true if all images specified in the config are cached, false otherwise.
	AreImagesCached(config *ImageCacheConfig) bool

	// GetCachedImages returns a map of cached image names. A map is used to make lookup for a specific image easier.
	GetCachedImages(config *ImageCacheConfig) map[string]bool

	// GetDockerImages returns a map of images available in the Docker daemon. A map is used to make lookup for a specific image easier.
	GetDockerImages() (map[string]bool, error)
}

ImageHandler is responsible for the import and export of images into the Docker daemon of the VM

type ImageMissStrategy

type ImageMissStrategy int
const (
	Skip ImageMissStrategy = iota
	Pull
)

type Index added in v1.10.0

type Index struct {
	Manifests     Manifests     `json:"manifests"`
	SchemaVersion SchemaVersion `json:"schemaVersion"`
}

type Manifest added in v1.10.0

type Manifest struct {
	Annotations Annotations `json:"annotations"`
	Digest      string      `json:"digest"`
	MediaType   string      `json:"mediaType"`
	Platform    Platform    `json:"platform"`
	Size        int64       `json:"size"`
}

type Manifests added in v1.10.0

type Manifests []Manifest

type OciImageHandler added in v1.10.0

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

OciImageHandler is an ImageHandler implementation using OCI format to maintain the local cache.

func NewLocalOnlyOciImageHandler added in v1.10.0

func NewLocalOnlyOciImageHandler() (*OciImageHandler, error)

NewLocalOnlyOciImageHandler creates a new ImageHandler which can only interact with the local cache. No connection information to the Docker daemon are provided. Functions interacting with the Docker daemon will fail.

func NewOciImageHandler added in v1.10.0

func NewOciImageHandler(driver drivers.Driver, dockerEnv map[string]string) (*OciImageHandler, error)

NewOciImageHandler creates a new ImageHandler which stores cached images in OCI format. It takes a reference to a Driver in order to communicate with the VM and Docker and a map containing the environment settings for the Minishift Docker daemon.

func (*OciImageHandler) AreImagesCached added in v1.10.0

func (handler *OciImageHandler) AreImagesCached(config *ImageCacheConfig) bool

AreImagesCached returns true if all images specified in the config are cached, false otherwise.

func (*OciImageHandler) ExportImages added in v1.10.0

func (handler *OciImageHandler) ExportImages(config *ImageCacheConfig, overwrite bool) ([]string, error)

ExportImages exports the images specified as part of the ImageCacheConfig from the VM to the host.

func (*OciImageHandler) GetCachedImages added in v1.10.0

func (handler *OciImageHandler) GetCachedImages(config *ImageCacheConfig) map[string]bool

func (*OciImageHandler) GetDockerImages added in v1.10.0

func (handler *OciImageHandler) GetDockerImages() (map[string]bool, error)

func (*OciImageHandler) ImportImages added in v1.10.0

func (handler *OciImageHandler) ImportImages(config *ImageCacheConfig) ([]string, error)

ImportImages imports cached images from the host into the Docker daemon of the VM.

func (*OciImageHandler) IsImageCached added in v1.10.0

func (handler *OciImageHandler) IsImageCached(config *ImageCacheConfig, image string) bool

IsImageCached returns true if the specified image is cached, false otherwise.

func (*OciImageHandler) PruneImages added in v1.18.0

func (handler *OciImageHandler) PruneImages(config *ImageCacheConfig) ([]string, error)

PruneImages delete the specified as command line option.

type Platform added in v1.18.0

type Platform struct {
	Architecture string `json:"architecture"`
	Os           string `json:"os"`
}

type ProgressStatus added in v1.11.0

type ProgressStatus int

ProgressStatus defines a status code for import/export operations.

const (
	OK ProgressStatus = iota
	FAIL
	CACHE_MISS
)

func (ProgressStatus) String added in v1.11.0

func (ps ProgressStatus) String() string

type SchemaVersion added in v1.26.0

type SchemaVersion int

Jump to

Keyboard shortcuts

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