extensions

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// Always is default restart policy what means that every time when container stops, it should be restarted.
	Always = iota
	// OnFailure means that only if process fails (non zero exit code) the container should be restarted
	OnFailure
)

Variables

This section is empty.

Functions

func IncrementRestart

func IncrementRestart(ctx context.Context, client *containerd.Client, c *containers.Container) error

IncrementRestart is containerd.UpdateContainerOpts implementation what increments restart counter

func WithLifecycleExtension

func WithLifecycleExtension(ctx context.Context, client *containerd.Client, c *containers.Container) error

WithLifecycleExtension is containerd.NewContainerOpts implementation what add lifecycle extension data to the container object.

func WithPipeExtension

func WithPipeExtension(pipe PipeSet) containerd.NewContainerOpts

WithPipeExtension appends pipe extension data to the container object.

Types

type ContainerLifecycle

type ContainerLifecycle struct {
	// StartCount gets incremented on every time when container get started
	// If value is zero, assumed that it's not yet created
	StartCount    int
	RestartPolicy RestartPolicy
}

ContainerLifecycle contains all lifecycle related information like restart counter and restart policy.

func GetLifecycleExtension

func GetLifecycleExtension(c containers.Container) (ContainerLifecycle, error)

GetLifecycleExtension returns ContainerLifecycle from container extensions or nil if not defined

type PipeFromStdout

type PipeFromStdout struct {
	Stdin PipeToStdin
}

PipeFromStdout defines container stdout as source for the piping

type PipeSet

type PipeSet struct {
	Stdout PipeFromStdout
}

PipeSet allows defining pipe from some source(s) to another container

func GetPipeExtension

func GetPipeExtension(container containers.Container) (*PipeSet, error)

GetPipeExtension returns PipeSet from container extensions or nil if not defined

type PipeToStdin

type PipeToStdin struct {
	Name string
}

PipeToStdin defines container stdin as target for the piping

type RestartPolicy

type RestartPolicy int

RestartPolicy describes policy for restarting th econtainer

func (RestartPolicy) String

func (p RestartPolicy) String() string

Jump to

Keyboard shortcuts

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