executor

package
v0.45.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineStageStatus

func DetermineStageStatus(sig StopSignalType, ori, got model.StageStatus) model.StageStatus

func NewStopSignal

func NewStopSignal() (StopSignal, StopSignalHandler)

Types

type AnalysisResultStore

type AnalysisResultStore interface {
	GetLatestAnalysisResult(ctx context.Context) (*model.AnalysisResult, error)
	PutLatestAnalysisResult(ctx context.Context, analysisResult *model.AnalysisResult) error
}

type AppLiveResourceLister

type AppLiveResourceLister interface {
	ListKubernetesResources() ([]provider.Manifest, bool)
}

type CommandLister

type CommandLister interface {
	ListCommands() []model.ReportableCommand
}

type Executor

type Executor interface {
	// Execute starts running executor until completion
	// or the StopSignal has emitted.
	Execute(sig StopSignal) model.StageStatus
}

type Factory

type Factory func(in Input) Executor

type GitClient

type GitClient interface {
	Clone(ctx context.Context, repoID, remote, branch, destination string) (git.Repo, error)
}

type Input

type Input struct {
	Stage       *model.PipelineStage
	StageConfig config.PipelineStage
	// Readonly deployment model.
	Deployment  *model.Deployment
	Application *model.Application
	PipedConfig *config.PipedSpec
	// Deploy source at target commit
	TargetDSP deploysource.Provider
	// Deploy source at running commit
	RunningDSP            deploysource.Provider
	GitClient             GitClient
	CommandLister         CommandLister
	LogPersister          LogPersister
	MetadataStore         metadatastore.MetadataStore
	AppManifestsCache     cache.Cache
	AppLiveResourceLister AppLiveResourceLister
	AnalysisResultStore   AnalysisResultStore
	Logger                *zap.Logger
	Notifier              Notifier
}

type LogPersister

type LogPersister interface {
	Write(log []byte) (int, error)
	Info(log string)
	Infof(format string, a ...interface{})
	Success(log string)
	Successf(format string, a ...interface{})
	Error(log string)
	Errorf(format string, a ...interface{})
}

type Notifier

type Notifier interface {
	Notify(event model.NotificationEvent)
}

type StopSignal

type StopSignal interface {
	Context() context.Context
	Ch() <-chan StopSignalType
	Signal() StopSignalType
	Terminated() bool
}

type StopSignalHandler

type StopSignalHandler interface {
	Cancel()
	Timeout()
	Terminate()
}

type StopSignalType

type StopSignalType string
const (
	// StopSignalTerminate means the executor should stop its execution
	// because the program was asked to terminate.
	StopSignalTerminate StopSignalType = "terminate"
	// StopSignalCancel means the executor should stop its execution
	// because the deployment was cancelled.
	StopSignalCancel StopSignalType = "cancel"
	// StopSignalTimeout means the executor should stop its execution
	// because of timeout.
	StopSignalTimeout StopSignalType = "timeout"
	// StopSignalNone means the excutor can be continuously executed.
	StopSignalNone StopSignalType = "none"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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