controller

package
v0.50.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package controller provides a piped component that handles all of the not completed deployments by managing a pool of planners and schedulers. Whenever a new PENDING deployment is detected, controller spawns a new planner for deciding the deployment pipeline and update the deployment status to PLANNED. Whenever a new PLANNED deployment is detected, controller spawns a new scheduler for scheduling and running its pipeline executors.

Package controller provides a piped component that handles all of the not completed deployments by managing a pool of planners and schedulers. Whenever a new PENDING deployment is detected, controller spawns a new planner for deciding the deployment pipeline and update the deployment status to PLANNED. Whenever a new PLANNED deployment is detected, controller spawns a new scheduler for scheduling and running its pipeline executors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStopSignal added in v0.50.0

func NewStopSignal() (StopSignal, StopSignalHandler)

Types

type DeploymentController

type DeploymentController interface {
	Run(ctx context.Context) error
}

func NewController

func NewController(
	apiClient apiClient,
	gitClient gitClient,
	deploymentLister deploymentLister,
	commandLister commandLister,
	notifier notifier,
	gracePeriod time.Duration,
	logger *zap.Logger,
	tracerProvider trace.TracerProvider,
) DeploymentController

NewController creates a new instance for DeploymentController.

type PluginRegistry

type PluginRegistry interface {
	Plugin(k model.ApplicationKind) (pluginapi.PluginClient, bool)
}

func DefaultPluginRegistry

func DefaultPluginRegistry() PluginRegistry

type StopSignal added in v0.50.0

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

type StopSignalHandler added in v0.50.0

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

type StopSignalType added in v0.50.0

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