steps

package
v0.0.0-...-f0c9d02 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

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 (
	CheckFailedCount = "ChecksFailedCount"
)
View Source
const ExitTimeout = 1 * time.Second

Variables

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

Functions

func NewBackground

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

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 NewEmitCheckFailureMetricStep

func NewEmitCheckFailureMetricStep(
	checkStep ifrit.Runner,
	checkProtocol executor.CheckProtocol,
	checkType executor.HealthcheckType,
	metronClient loggingclient.IngressClient) ifrit.Runner

func NewEmitProgress

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

func NewEventuallySucceedsStep

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

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

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

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

func NewParallel

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

func NewReadinessHealthCheckStep

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

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

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

func NewTimedStep

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

type CancelledError struct{}

func (*CancelledError) Error

func (e *CancelledError) Error() string

func (*CancelledError) IsDisplayable

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

type ExceededGracefulShutdownIntervalError struct{}

func (*ExceededGracefulShutdownIntervalError) Error

func (*ExceededGracefulShutdownIntervalError) IsDisplayable

func (e *ExceededGracefulShutdownIntervalError) IsDisplayable() bool

type ExitTimeoutError

type ExitTimeoutError struct{}

func (*ExitTimeoutError) Error

func (e *ExitTimeoutError) Error() string

type IsDisplayableError

type IsDisplayableError interface {
	IsDisplayable() bool
}

type ReadSizer

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

func (*ReadSizer) BytesRead

func (r *ReadSizer) BytesRead() int

func (*ReadSizer) Read

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

type ReadinessState

type ReadinessState int
const (
	IsReady ReadinessState = iota
	IsNotReady
)

type Sidecar

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