Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicHTTPMaintenanceTrigger ¶
type BasicHTTPMaintenanceTrigger struct {
// contains filtered or unexported fields
}
BasicHTTPMaintenanceTrigger gets the critical status from an HTTP response containing only a truthy or falsy string. This is used typically to trigger emergency maintenances from a file hosted in a s3 bucket or raw file served over HTTP. BasicHTTPMaintenanceTrigger uses basicHTTPMaintenanceClient and wraps it in a cache in order to mitigate the impact of too frequent reconciliations. The structure implements the maintenance.Trigger interface.
func (BasicHTTPMaintenanceTrigger) Default ¶
func (g BasicHTTPMaintenanceTrigger) Default() bool
Default returns what to do if the trigger can't be evaluated. BasicHTTPMaintenanceTrigger should fail open, so the function returns true.
func (BasicHTTPMaintenanceTrigger) Name ¶
func (g BasicHTTPMaintenanceTrigger) Name() string
Name implements maintenance.Triggernd returns the trigger name for logging and debugging pursposes.
type Trigger ¶
type Trigger interface { Name() string CanStart(ctx context.Context, object client.Object) (bool, error) Default() bool }
Trigger is evaluated to decide whether a maintenance can happen or not. Maintenances can happen because of multiple reasons like: - attempt to recover from a broken state - we are in a maintenance window - emergency security patch Each Trigger has a Name() for logging purposes and a Default() method returning whether the trigger should allow the maintenance or not in case\ of error.
func NewBasicHTTPMaintenanceTrigger ¶
NewBasicHTTPMaintenanceTrigger builds and return a Trigger checking a public HTTP endpoint.
func NewMaintenanceTriggerMock ¶
NewMaintenanceTriggerMock creates a TriggerMock
func NewUnhealthyWorkloadTrigger ¶
NewUnhealthyWorkloadTrigger triggers a maintenance if the watched workload is unhealthy.
type TriggerMock ¶
type TriggerMock struct {
// contains filtered or unexported fields
}
TriggerMock is a fake Trigger that return a static answer. This is used for testing purposes and is inherently disruptive.
func (TriggerMock) Default ¶
func (m TriggerMock) Default() bool
Default returns the default behavior if the trigger fails. This cannot happen for a TriggerMock and is here solely to implement the Trigger interface.