gates

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoRequeueInterval time.Duration

NoRequeueInterval is a simple default value that can be used to indicate that a Gate should not requeue after a time duration.

Functions

func Check

Check checks the gates defined in the KustomizationAutoDeployer and returns true if all gates are open.

Types

type Gate

type Gate interface {
	// Check returns true if the Gate is open.
	//
	// Errors are only for exceptional cases.
	Check(context.Context, *deployerv1.KustomizationGate, *deployerv1.KustomizationAutoDeployer) (bool, error)

	// Interval is the time after which a Gate should be checked.
	//
	// A Gate can return an empty time.Duration value if it should not be
	// rechecked after a period.
	Interval(*deployerv1.KustomizationGate) (time.Duration, error)
}

Gate defines the interface implemented by all gates.

func FindRelevantGates

func FindRelevantGates(setGate deployerv1.KustomizationGate, enabledGates map[string]Gate) ([]Gate, error)

FindRelevantGates takes a struct with keys of the same type as Gates in the map and finds relevant gates.

type GateFactory

type GateFactory func(logr.Logger, client.Client) Gate

GateFactory is a way to create a per-reconciliation gate.

type GateNotEnabledError

type GateNotEnabledError struct {
	Name string
}

GateNotEnabledError is returned when a gate is not enabled in the controller but a gated deploy tries to use it. If you want to handle this error you can either use errors.As(err, &GateNotEnabledError{}) to check for any gate, or use errors.Is(err, GateNotEnabledError{Name: HealthCheckGate}) for a specific gate.

func (GateNotEnabledError) Error

func (g GateNotEnabledError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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