Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
func Check(ctx context.Context, r *deployerv1.KustomizationAutoDeployer, configuredGates map[string]Gate) (bool, deployerv1.GatesStatus, error)
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 ¶
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