worker

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidImage = errors.New("invlid image name")
	ErrCommit       = errors.New("container commit failed")
	ErrPush         = errors.New("image push failed")
)

Functions

This section is empty.

Types

type DockerClient

type DockerClient interface {
	ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error)
	ImagePush(ctx context.Context, ref string, options types.ImagePushOptions) (io.ReadCloser, error)
}

DockerClient is a subset of docker CommonAPIClient, to make the worker interface simpler

type Error

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

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type SnapshotOptions

type SnapshotOptions struct {
	// docker registry auth header, from imagePushSecret
	// see: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#inspecting-the-secret-regcred
	Container string `json:"container,omitempty"`
	Image     string `json:"image,omitempty"` // image full name: host/path/image:tag
	Author    string `json:"author,omitempty"`
	Comment   string `json:"comment,omitempty"`
}

type Worker

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

func New

func New(cli DockerClient, authpath string) (*Worker, error)

func (*Worker) TakeSnapshot

func (c *Worker) TakeSnapshot(ctx context.Context, opt *SnapshotOptions) error

Jump to

Keyboard shortcuts

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