trigger

package
v0.49.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package trigger provides a piped component that detects a list of application should be synced (by new commit, sync command or configuration drift) and then sends request to the control-plane to create a new Deployment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Determiner

type Determiner interface {
	ShouldTrigger(ctx context.Context, app *model.Application, appCfg *config.GenericApplicationSpec) (bool, error)
}

func NewOnCommitDeterminer

func NewOnCommitDeterminer(repo git.Repo, targetCommit string, cg LastTriggeredCommitGetter, logger *zap.Logger) Determiner

type LastTriggeredCommitGetter

type LastTriggeredCommitGetter interface {
	Get(ctx context.Context, applicationID string) (string, error)
}

type OnChainDeterminer

type OnChainDeterminer struct {
}

func NewOnChainDeterminer

func NewOnChainDeterminer() *OnChainDeterminer

func (*OnChainDeterminer) ShouldTrigger

type OnCommandDeterminer

type OnCommandDeterminer struct {
}

func NewOnCommandDeterminer

func NewOnCommandDeterminer() *OnCommandDeterminer

func (*OnCommandDeterminer) ShouldTrigger

ShouldTrigger decides whether a given application should be triggered or not.

type OnCommitDeterminer

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

func (*OnCommitDeterminer) ShouldTrigger

func (d *OnCommitDeterminer) ShouldTrigger(ctx context.Context, app *model.Application, appCfg *config.GenericApplicationSpec) (bool, error)

ShouldTrigger decides whether a given application should be triggered or not.

type OnOutOfSyncDeterminer

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

func NewOnOutOfSyncDeterminer

func NewOnOutOfSyncDeterminer(client apiClient) *OnOutOfSyncDeterminer

func (*OnOutOfSyncDeterminer) ShouldTrigger

ShouldTrigger decides whether a given application should be triggered or not.

type Trigger

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

func NewTrigger

func NewTrigger(
	apiClient apiClient,
	gitClient gitClient,
	appLister applicationLister,
	commandLister commandLister,
	notifier notifier,
	cfg *config.PipedSpec,
	gracePeriod time.Duration,
	logger *zap.Logger,
) (*Trigger, error)

func (*Trigger) GetLastTriggeredCommitGetter

func (t *Trigger) GetLastTriggeredCommitGetter() LastTriggeredCommitGetter

func (*Trigger) Run

func (t *Trigger) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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