containerupdate

package
v0.33.14 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GenericExitCodeKilled indicates the container runtime killed the process.
	GenericExitCodeKilled = 137

	// GenericExitCodeCannotExec indicates the command cannot be executed.
	// In a shell, this generally is a form of permission issues (i.e. the
	// binary was found but is not +x). However, container runtimes also
	// use this to indicate that the binary wasn't found at all, which is
	// extremely common when we try to use common tools such as `tar` but
	// the image is missing them.
	GenericExitCodeCannotExec = 126

	GenericExitCodeNotFound = 127
)
View Source
const TarExitCodePermissionDenied = 2

TarExitCodePermissionDenied is returned by `tar` if it does not have sufficient permissions to write the extracted files.

Variables

This section is empty.

Functions

func ExtractExitCode added in v0.26.0

func ExtractExitCode(err error) (int, bool)

ExtractExitCode returns exit status information from different types of errors.

Types

type ContainerUpdater

type ContainerUpdater interface {
	UpdateContainer(ctx context.Context, cInfo liveupdates.Container,
		archiveToCopy io.Reader, filesToDelete []string, cmds []model.Cmd, hotReload bool) error
}

type DockerUpdater added in v0.17.0

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

func NewDockerUpdater added in v0.17.0

func NewDockerUpdater(dCli docker.Client) *DockerUpdater

func (*DockerUpdater) UpdateContainer added in v0.17.0

func (cu *DockerUpdater) UpdateContainer(ctx context.Context, cInfo liveupdates.Container,
	archiveToCopy io.Reader, filesToDelete []string, cmds []model.Cmd, hotReload bool) error

func (*DockerUpdater) WillBuildToKubeContext added in v0.20.7

func (cu *DockerUpdater) WillBuildToKubeContext(kctx k8s.KubeContext) bool

type ExecError added in v0.26.0

type ExecError struct {
	Cmd      model.Cmd
	ExitCode int
}

func NewExecError added in v0.26.0

func NewExecError(cmd model.Cmd, exitCode int) ExecError

func (ExecError) Error added in v0.26.0

func (e ExecError) Error() string

type ExecUpdater

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

func NewExecUpdater

func NewExecUpdater(kCli k8s.Client) *ExecUpdater

func (*ExecUpdater) UpdateContainer

func (cu *ExecUpdater) UpdateContainer(ctx context.Context, cInfo liveupdates.Container,
	archiveToCopy io.Reader, filesToDelete []string, cmds []model.Cmd, hotReload bool) error

type FakeContainerUpdater

type FakeContainerUpdater struct {
	UpdateErrs []error

	Calls []UpdateContainerCall
}

func (*FakeContainerUpdater) SetUpdateErr added in v0.10.0

func (cu *FakeContainerUpdater) SetUpdateErr(err error)

func (*FakeContainerUpdater) UpdateContainer

func (cu *FakeContainerUpdater) UpdateContainer(ctx context.Context, cInfo liveupdates.Container,
	archiveToCopy io.Reader, filesToDelete []string, cmds []model.Cmd, hotReload bool) error

type UpdateContainerCall

type UpdateContainerCall struct {
	ContainerInfo liveupdates.Container
	Archive       io.Reader
	ToDelete      []string
	Cmds          []model.Cmd
	HotReload     bool
}

Jump to

Keyboard shortcuts

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