Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionBuilder ¶
type ActionBuilder func(v1alpha1.Action, ActionContext, bool) Action
type ActionContext ¶
type ActionContext struct { Client client.Client RestConfig *rest.Config Recorder record.EventRecorder CounterMeasure v1alpha1.CounterMeasure }
type ActionRunner ¶
type ActionRunner interface {
Run(ActionContext, events.Event)
}
type BaseAction ¶
type BaseAction struct { DryRun bool RetryEnabled bool Name string // contains filtered or unexported fields }
func (*BaseAction) GetName ¶
func (b *BaseAction) GetName() string
func (*BaseAction) SupportsRetry ¶
func (b *BaseAction) SupportsRetry() bool
type Debug ¶
type Debug struct { BaseAction // contains filtered or unexported fields }
func NewDebugAction ¶
func NewDebugAction(coreV1Client clientCoreV1.CoreV1Interface, client client.Client, spec v1alpha1.DebugSpec) *Debug
func NewDebugFromBase ¶
func NewDebugFromBase(base BaseAction, coreV1Client clientCoreV1.CoreV1Interface, spec v1alpha1.DebugSpec) *Debug
type Delete ¶
type Delete struct { BaseAction // contains filtered or unexported fields }
func NewDeleteAction ¶
func NewDeleteAction(client client.Client, spec v1alpha1.DeleteSpec) *Delete
func NewDeleteFromBase ¶
func NewDeleteFromBase(base BaseAction, spec v1alpha1.DeleteSpec) *Delete
func (*Delete) GetTargetObjectName ¶
type InMemoryRunner ¶
type InMemoryRunner []Action
func (InMemoryRunner) Run ¶
func (seq InMemoryRunner) Run(eventCtx ActionContext, event events.Event)
Run called with an event when the counter measure actions need to be exeucted.
type Manager ¶
type Manager struct { ActionRegistry Registry // contains filtered or unexported fields }
func NewFromManager ¶
func NewFromManager(mgr controller.Manager, bus *eventbus.EventBus) *Manager
NewFromManager construct a new action manager
func (*Manager) Add ¶
func (m *Manager) Add(cm *v1alpha1.CounterMeasure) error
Add install a countermeasure to route events to
type Patch ¶
type Patch struct { BaseAction // contains filtered or unexported fields }
func NewPatchFromBase ¶
func NewPatchFromBase(base BaseAction, spec v1alpha1.PatchSpec) *Patch
type PatchData ¶
type PatchData struct { events.EventData *unstructured.Unstructured }
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) Initialize ¶
func (r *Registry) Initialize()
Initialize registers all the known actions with the registry
func (*Registry) NewRunner ¶
func (r *Registry) NewRunner(ctx ActionContext) (ActionRunner, error)
ConvertToHandler converts a countermeasure and all actions within into a handler for source events.
func (*Registry) RegisterAction ¶
func (r *Registry) RegisterAction(prototype interface{}, builder ActionBuilder)
RegisterAction register a new action with the registry
type Restart ¶
type Restart struct { BaseAction // contains filtered or unexported fields }
func NewRestartAction ¶
func NewRestartAction(client client.Client, spec v1alpha1.RestartSpec) *Restart
func NewRestartFromBase ¶
func NewRestartFromBase(base BaseAction, spec v1alpha1.RestartSpec) *Restart
func (*Restart) GetTargetObjectName ¶
Click to show internal directories.
Click to hide internal directories.