steps

package
v0.1442.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 24 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ContainerSetupSucceededDuration = "ContainerSetupSucceededDuration"
	ContainerSetupFailedDuration    = "ContainerSetupFailedDuration"
)
View Source
const (
	ErrCreateTmpDir    = "Failed to create temp dir"
	ErrEstablishStream = "Failed to establish stream from container"
	ErrReadTar         = "Failed to find first item in tar stream"
	ErrCreateTmpFile   = "Failed to create temp file"
	ErrCopyStreamToTmp = "Failed to copy stream contents into temp file"
	ErrParsingURL      = "Failed to parse URL"
)
View Source
const ExitTimeout = 1 * time.Second

Variables

View Source
var CodependentStepExitedError = errors.New("Codependent step exited")

Functions

func NewBackground added in v0.1442.0

func NewBackground(substep ifrit.Runner, logger lager.Logger) ifrit.Runner

func NewCodependent

func NewCodependent(substeps []ifrit.Runner, errorOnExit bool, cancelOthersOnExit bool) ifrit.Runner

func NewConsistentlySucceedsStep added in v0.1442.0

func NewConsistentlySucceedsStep(create func() ifrit.Runner, frequency time.Duration, clock clock.Clock) ifrit.Runner

TODO: use a workpool when running the substep

func NewDownload

func NewDownload(
	container garden.Container,
	model models.DownloadAction,
	cachedDownloader cacheddownloader.CachedDownloader,
	rateLimiter chan struct{},
	streamer log_streamer.LogStreamer,
	logger lager.Logger,
) ifrit.Runner

func NewEmitProgress

func NewEmitProgress(
	substep ifrit.Runner,
	startMessage,
	successMessage,
	failureMessage string,
	streamer log_streamer.LogStreamer,
	logger lager.Logger,
) *emitProgressStep

func NewEventuallySucceedsStep added in v0.1442.0

func NewEventuallySucceedsStep(create func() ifrit.Runner, frequency, timeout time.Duration, clock clock.Clock) ifrit.Runner

TODO: use a workpool when running the substep

func NewHealthCheckStep added in v0.1442.0

func NewHealthCheckStep(
	startupCheck ifrit.Runner,
	livenessCheck ifrit.Runner,
	logger lager.Logger,
	clock clock.Clock,
	logStreamer log_streamer.LogStreamer,
	healthcheckStreamer log_streamer.LogStreamer,
	startTimeout time.Duration,
) ifrit.Runner

func NewMonitor

func NewMonitor(
	checkFunc func() ifrit.Runner,
	logger lager.Logger,
	clock clock.Clock,
	logStreamer log_streamer.LogStreamer,
	startTimeout time.Duration,
	healthyInterval time.Duration,
	unhealthyInterval time.Duration,
	workPool *workpool.WorkPool,
	proxyStartupChecks ...ifrit.Runner,
) ifrit.Runner

func NewOutputWrapper added in v0.1442.0

func NewOutputWrapper(substep ifrit.Runner, reader io.Reader) ifrit.Runner

This step ignores the error from the substep and returns the content of Reader as an emittable error. This is used to wrap the output of the healthcheck as the error instead of using the exit status or the process

func NewOutputWrapperWithPrefix added in v0.1442.0

func NewOutputWrapperWithPrefix(substep ifrit.Runner, reader io.Reader, prefix string) ifrit.Runner

func NewParallel

func NewParallel(substeps []ifrit.Runner) *parallelStep

func NewReadinessHealthCheckStep added in v0.1442.0

func NewReadinessHealthCheckStep(
	untilReadyCheck ifrit.Runner,
	untilFailureCheck ifrit.Runner,
	logStreamer log_streamer.LogStreamer,
	readinessChan chan ReadinessState,
	logger lager.Logger,
) ifrit.Runner

func NewRun

func NewRun(
	container garden.Container,
	model models.RunAction,
	streamer log_streamer.LogStreamer,
	logger lager.Logger,
	externalIP string,
	internalIP string,
	portMappings []executor.PortMapping,
	clock clock.Clock,
	gracefulShutdownInterval time.Duration,
	suppressExitStatusCode bool,
) *runStep

func NewRunWithSidecar added in v0.1442.0

func NewRunWithSidecar(
	container garden.Container,
	model models.RunAction,
	streamer log_streamer.LogStreamer,
	logger lager.Logger,
	externalIP string,
	internalIP string,
	portMappings []executor.PortMapping,
	clock clock.Clock,
	gracefulShutdownInterval time.Duration,
	suppressExitStatusCode bool,
	sidecar Sidecar,
	privileged bool,
) *runStep

func NewSerial

func NewSerial(steps []ifrit.Runner) ifrit.Runner

func NewThrottle added in v0.1442.0

func NewThrottle(substep ifrit.Runner, workPool *workpool.WorkPool) *throttleStep

func NewTimedStep added in v0.1442.0

func NewTimedStep(logger lager.Logger, step ifrit.Runner, metronClient loggingclient.IngressClient, clock clock.Clock, startTime time.Time) ifrit.Runner

func NewTimeout

func NewTimeout(substep ifrit.Runner, timeout time.Duration, clock clock.Clock, logger lager.Logger) ifrit.Runner

func NewTry

func NewTry(substep ifrit.Runner, logger lager.Logger) ifrit.Runner

func NewUpload

func NewUpload(
	container garden.Container,
	model models.UploadAction,
	uploader uploader.Uploader,
	compressor compressor.Compressor,
	tempDir string,
	streamer log_streamer.LogStreamer,
	rateLimiter chan struct{},
	logger lager.Logger,
) ifrit.Runner

Types

type CancelledError added in v0.1442.0

type CancelledError struct{}

func (*CancelledError) Error added in v0.1442.0

func (e *CancelledError) Error() string

func (*CancelledError) IsDisplayable added in v0.1442.0

func (e *CancelledError) IsDisplayable() bool

type EmittableError

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

func NewEmittableError

func NewEmittableError(wrappedError error, message string, args ...interface{}) *EmittableError

func (*EmittableError) Error

func (e *EmittableError) Error() string

func (*EmittableError) WrappedError

func (e *EmittableError) WrappedError() error

type ExceededGracefulShutdownIntervalError added in v0.1442.0

type ExceededGracefulShutdownIntervalError struct{}

func (*ExceededGracefulShutdownIntervalError) Error added in v0.1442.0

func (*ExceededGracefulShutdownIntervalError) IsDisplayable added in v0.1442.0

func (e *ExceededGracefulShutdownIntervalError) IsDisplayable() bool

type ExitTimeoutError added in v0.1442.0

type ExitTimeoutError struct{}

func (*ExitTimeoutError) Error added in v0.1442.0

func (e *ExitTimeoutError) Error() string

type IsDisplayableError added in v0.1442.0

type IsDisplayableError interface {
	IsDisplayable() bool
}

type ReadSizer added in v0.1442.0

type ReadSizer struct {
	io.Reader
	// contains filtered or unexported fields
}

func (*ReadSizer) BytesRead added in v0.1442.0

func (r *ReadSizer) BytesRead() int

func (*ReadSizer) Read added in v0.1442.0

func (r *ReadSizer) Read(dest []byte) (int, error)

type ReadinessState added in v0.1442.0

type ReadinessState int
const (
	IsReady ReadinessState = iota
	IsNotReady
)

type Sidecar added in v0.1442.0

type Sidecar struct {
	Image                   garden.ImageRef
	Name                    string
	BindMounts              []garden.BindMount
	OverrideContainerLimits *garden.ProcessLimits
}

Jump to

Keyboard shortcuts

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