Documentation ¶
Index ¶
- Variables
- func ConvertKubeEventToBindingContext(kubeEvent KubeEvent, link *KubernetesBindingToMonitorLink) []BindingContext
- type AdmissionBindingToWebhookLink
- type AdmissionBindingsController
- func (c *AdmissionBindingsController) CanHandleEvent(event admission.Event) bool
- func (c *AdmissionBindingsController) DisableMutatingBindings()
- func (c *AdmissionBindingsController) DisableValidatingBindings()
- func (c *AdmissionBindingsController) EnableMutatingBindings()
- func (c *AdmissionBindingsController) EnableValidatingBindings()
- func (c *AdmissionBindingsController) HandleEvent(event admission.Event) BindingExecutionInfo
- func (c *AdmissionBindingsController) WithMutatingBindings(bindings []MutatingConfig)
- func (c *AdmissionBindingsController) WithValidatingBindings(bindings []ValidatingConfig)
- func (c *AdmissionBindingsController) WithWebhookManager(mgr *admission.WebhookManager)
- type BindingExecutionInfo
- type ConversionBindingToWebhookLink
- type ConversionBindingsController
- func (c *ConversionBindingsController) CanHandleEvent(crdName string, request *v1.ConversionRequest, rule conversion.Rule) bool
- func (c *ConversionBindingsController) DisableConversionBindings()
- func (c *ConversionBindingsController) EnableConversionBindings()
- func (c *ConversionBindingsController) HandleEvent(crdName string, request *v1.ConversionRequest, rule conversion.Rule) BindingExecutionInfo
- func (c *ConversionBindingsController) WithBindings(bindings []ConversionConfig)
- func (c *ConversionBindingsController) WithWebhookManager(mgr *conversion.WebhookManager)
- type HookController
- func (hc *HookController) CanHandleAdmissionEvent(event admission.Event) bool
- func (hc *HookController) CanHandleConversionEvent(crdName string, event *v1.ConversionRequest, rule conversion.Rule) bool
- func (hc *HookController) CanHandleKubeEvent(kubeEvent KubeEvent) bool
- func (hc *HookController) CanHandleScheduleEvent(crontab string) bool
- func (hc *HookController) DisableScheduleBindings()
- func (hc *HookController) EnableAdmissionBindings()
- func (hc *HookController) EnableConversionBindings()
- func (hc *HookController) EnableScheduleBindings()
- func (hc *HookController) HandleAdmissionEvent(event admission.Event, createTasksFn func(BindingExecutionInfo))
- func (hc *HookController) HandleConversionEvent(crdName string, request *v1.ConversionRequest, rule conversion.Rule, ...)
- func (hc *HookController) HandleEnableKubernetesBindings(createTasksFn func(BindingExecutionInfo)) error
- func (hc *HookController) HandleKubeEvent(event KubeEvent, createTasksFn func(BindingExecutionInfo))
- func (hc *HookController) HandleScheduleEvent(crontab string, createTasksFn func(BindingExecutionInfo))
- func (hc *HookController) InitAdmissionBindings(vbindings []ValidatingConfig, mbindings []MutatingConfig, ...)
- func (hc *HookController) InitConversionBindings(bindings []ConversionConfig, webhookMgr *conversion.WebhookManager)
- func (hc *HookController) InitKubernetesBindings(bindings []OnKubernetesEventConfig, ...)
- func (hc *HookController) InitScheduleBindings(bindings []ScheduleConfig, scheduleMgr schedule_manager.ScheduleManager)
- func (hc *HookController) KubernetesSnapshots() map[string][]ObjectAndFilterResult
- func (hc *HookController) SnapshotsDump() map[string]interface{}
- func (hc *HookController) SnapshotsInfo() []string
- func (hc *HookController) StopMonitors()
- func (hc *HookController) UnlockKubernetesEvents()
- func (hc *HookController) UnlockKubernetesEventsFor(monitorID string)
- func (hc *HookController) UpdateMonitor(monitorId string, kind, apiVersion string) error
- func (hc *HookController) UpdateSnapshots(context []BindingContext) []BindingContext
- type KubernetesBindingToMonitorLink
- type KubernetesBindingsController
- type ScheduleBindingToCrontabLink
- type ScheduleBindingsController
Constants ¶
This section is empty.
Variables ¶
var NewConversionBindingsController = func() *ConversionBindingsController { return &ConversionBindingsController{ Links: make(map[string]map[conversion.Rule]*ConversionBindingToWebhookLink), } }
NewConversionBindingsController returns an implementation of ConversionBindingsController
var NewKubernetesBindingsController = func() *kubernetesBindingsController { return &kubernetesBindingsController{ BindingMonitorLinks: make(map[string]*KubernetesBindingToMonitorLink), } }
NewKubernetesBindingsController returns an implementation of KubernetesBindingsController
var NewScheduleBindingsController = func() *scheduleBindingsController { return &scheduleBindingsController{ ScheduleLinks: make(map[string]*ScheduleBindingToCrontabLink), } }
NewScheduleBindingsController returns an implementation of ScheduleBindingsController
var NewValidatingBindingsController = func() *AdmissionBindingsController { return &AdmissionBindingsController{ AdmissionLinks: make(map[string]*AdmissionBindingToWebhookLink), } }
NewValidatingBindingsController returns an implementation of AdmissionBindingsController
Functions ¶
func ConvertKubeEventToBindingContext ¶
func ConvertKubeEventToBindingContext(kubeEvent KubeEvent, link *KubernetesBindingToMonitorLink) []BindingContext
Types ¶
type AdmissionBindingToWebhookLink ¶ added in v1.2.0
type AdmissionBindingToWebhookLink struct { BindingType BindingType BindingName string ConfigurationId string WebhookId string // Useful fields to create a BindingContext IncludeSnapshots []string Group string }
AdmissionBindingToWebhookLink is a link between a hook and a webhook configuration.
type AdmissionBindingsController ¶ added in v1.2.0
type AdmissionBindingsController struct { // Controller holds validating/mutating bindings from one hook. Hook always belongs to one configurationId. ConfigurationId string // WebhookId -> link AdmissionLinks map[string]*AdmissionBindingToWebhookLink ValidatingBindings []ValidatingConfig MutatingBindings []MutatingConfig // contains filtered or unexported fields }
func (*AdmissionBindingsController) CanHandleEvent ¶ added in v1.2.0
func (c *AdmissionBindingsController) CanHandleEvent(event admission.Event) bool
func (*AdmissionBindingsController) DisableMutatingBindings ¶ added in v1.2.0
func (c *AdmissionBindingsController) DisableMutatingBindings()
func (*AdmissionBindingsController) DisableValidatingBindings ¶ added in v1.2.0
func (c *AdmissionBindingsController) DisableValidatingBindings()
func (*AdmissionBindingsController) EnableMutatingBindings ¶ added in v1.2.0
func (c *AdmissionBindingsController) EnableMutatingBindings()
func (*AdmissionBindingsController) EnableValidatingBindings ¶ added in v1.2.0
func (c *AdmissionBindingsController) EnableValidatingBindings()
func (*AdmissionBindingsController) HandleEvent ¶ added in v1.2.0
func (c *AdmissionBindingsController) HandleEvent(event admission.Event) BindingExecutionInfo
func (*AdmissionBindingsController) WithMutatingBindings ¶ added in v1.2.0
func (c *AdmissionBindingsController) WithMutatingBindings(bindings []MutatingConfig)
func (*AdmissionBindingsController) WithValidatingBindings ¶ added in v1.2.0
func (c *AdmissionBindingsController) WithValidatingBindings(bindings []ValidatingConfig)
func (*AdmissionBindingsController) WithWebhookManager ¶ added in v1.2.0
func (c *AdmissionBindingsController) WithWebhookManager(mgr *admission.WebhookManager)
type BindingExecutionInfo ¶
type ConversionBindingToWebhookLink ¶
type ConversionBindingToWebhookLink struct { BindingName string // Useful fields to create a BindingContext CrdName string FromVersion string ToVersion string IncludeSnapshots []string Group string }
A link between a hook and a kube monitor
type ConversionBindingsController ¶
type ConversionBindingsController struct { // crdName -> conversionRule id -> link Links map[string]map[conversion.Rule]*ConversionBindingToWebhookLink Bindings []ConversionConfig // contains filtered or unexported fields }
ConversionBindingsController holds validating bindings from one hook.
func (*ConversionBindingsController) CanHandleEvent ¶
func (c *ConversionBindingsController) CanHandleEvent(crdName string, request *v1.ConversionRequest, rule conversion.Rule) bool
func (*ConversionBindingsController) DisableConversionBindings ¶
func (c *ConversionBindingsController) DisableConversionBindings()
func (*ConversionBindingsController) EnableConversionBindings ¶
func (c *ConversionBindingsController) EnableConversionBindings()
func (*ConversionBindingsController) HandleEvent ¶
func (c *ConversionBindingsController) HandleEvent(crdName string, request *v1.ConversionRequest, rule conversion.Rule) BindingExecutionInfo
func (*ConversionBindingsController) WithBindings ¶
func (c *ConversionBindingsController) WithBindings(bindings []ConversionConfig)
func (*ConversionBindingsController) WithWebhookManager ¶
func (c *ConversionBindingsController) WithWebhookManager(mgr *conversion.WebhookManager)
type HookController ¶
type HookController struct { KubernetesController KubernetesBindingsController ScheduleController ScheduleBindingsController AdmissionController *AdmissionBindingsController ConversionController *ConversionBindingsController // contains filtered or unexported fields }
func NewHookController ¶
func NewHookController() *HookController
func (*HookController) CanHandleAdmissionEvent ¶ added in v1.2.0
func (hc *HookController) CanHandleAdmissionEvent(event admission.Event) bool
func (*HookController) CanHandleConversionEvent ¶
func (hc *HookController) CanHandleConversionEvent(crdName string, event *v1.ConversionRequest, rule conversion.Rule) bool
func (*HookController) CanHandleKubeEvent ¶
func (hc *HookController) CanHandleKubeEvent(kubeEvent KubeEvent) bool
func (*HookController) CanHandleScheduleEvent ¶
func (hc *HookController) CanHandleScheduleEvent(crontab string) bool
func (*HookController) DisableScheduleBindings ¶
func (hc *HookController) DisableScheduleBindings()
func (*HookController) EnableAdmissionBindings ¶ added in v1.2.0
func (hc *HookController) EnableAdmissionBindings()
func (*HookController) EnableConversionBindings ¶
func (hc *HookController) EnableConversionBindings()
func (*HookController) EnableScheduleBindings ¶
func (hc *HookController) EnableScheduleBindings()
func (*HookController) HandleAdmissionEvent ¶ added in v1.2.0
func (hc *HookController) HandleAdmissionEvent(event admission.Event, createTasksFn func(BindingExecutionInfo))
func (*HookController) HandleConversionEvent ¶
func (hc *HookController) HandleConversionEvent(crdName string, request *v1.ConversionRequest, rule conversion.Rule, createTasksFn func(BindingExecutionInfo))
func (*HookController) HandleEnableKubernetesBindings ¶
func (hc *HookController) HandleEnableKubernetesBindings(createTasksFn func(BindingExecutionInfo)) error
func (*HookController) HandleKubeEvent ¶
func (hc *HookController) HandleKubeEvent(event KubeEvent, createTasksFn func(BindingExecutionInfo))
func (*HookController) HandleScheduleEvent ¶
func (hc *HookController) HandleScheduleEvent(crontab string, createTasksFn func(BindingExecutionInfo))
func (*HookController) InitAdmissionBindings ¶ added in v1.2.0
func (hc *HookController) InitAdmissionBindings(vbindings []ValidatingConfig, mbindings []MutatingConfig, webhookMgr *admission.WebhookManager)
func (*HookController) InitConversionBindings ¶
func (hc *HookController) InitConversionBindings(bindings []ConversionConfig, webhookMgr *conversion.WebhookManager)
func (*HookController) InitKubernetesBindings ¶
func (hc *HookController) InitKubernetesBindings(bindings []OnKubernetesEventConfig, kubeEventMgr kube_events_manager.KubeEventsManager)
func (*HookController) InitScheduleBindings ¶
func (hc *HookController) InitScheduleBindings(bindings []ScheduleConfig, scheduleMgr schedule_manager.ScheduleManager)
func (*HookController) KubernetesSnapshots ¶
func (hc *HookController) KubernetesSnapshots() map[string][]ObjectAndFilterResult
KubernetesSnapshots returns a 'full snapshot': all snapshots for all registered kubernetes bindings. Note: no caching as in UpdateSnapshots because KubernetesSnapshots used for non-combined binding contexts.
func (*HookController) SnapshotsDump ¶ added in v1.0.8
func (hc *HookController) SnapshotsDump() map[string]interface{}
func (*HookController) SnapshotsInfo ¶ added in v1.0.8
func (hc *HookController) SnapshotsInfo() []string
func (*HookController) StopMonitors ¶
func (hc *HookController) StopMonitors()
func (*HookController) UnlockKubernetesEvents ¶
func (hc *HookController) UnlockKubernetesEvents()
func (*HookController) UnlockKubernetesEventsFor ¶
func (hc *HookController) UnlockKubernetesEventsFor(monitorID string)
func (*HookController) UpdateMonitor ¶ added in v1.0.2
func (hc *HookController) UpdateMonitor(monitorId string, kind, apiVersion string) error
func (*HookController) UpdateSnapshots ¶
func (hc *HookController) UpdateSnapshots(context []BindingContext) []BindingContext
UpdateSnapshots ensures fresh consistent snapshots for combined binding contexts.
It uses caching to retrieve snapshots for a particular binding name only once. This caching is important for Synchronization and self-includes: Combined "Synchronization" binging contexts or "Synchronization" with self-inclusion may require several calls to Snapshot*() methods, but objects may change between these calls.
type KubernetesBindingToMonitorLink ¶
type KubernetesBindingToMonitorLink struct { MonitorId string BindingConfig OnKubernetesEventConfig }
KubernetesBindingToMonitorLink is a link between a binding config and a Monitor.
type KubernetesBindingsController ¶
type KubernetesBindingsController interface { WithKubernetesBindings([]OnKubernetesEventConfig) WithKubeEventsManager(kube_events_manager.KubeEventsManager) EnableKubernetesBindings() ([]BindingExecutionInfo, error) UpdateMonitor(monitorId string, kind, apiVersion string) error UnlockEvents() UnlockEventsFor(monitorID string) StopMonitors() CanHandleEvent(kubeEvent KubeEvent) bool HandleEvent(kubeEvent KubeEvent) BindingExecutionInfo BindingNames() []string SnapshotsFrom(bindingNames ...string) map[string][]ObjectAndFilterResult SnapshotsFor(bindingName string) []ObjectAndFilterResult Snapshots() map[string][]ObjectAndFilterResult SnapshotsInfo() []string SnapshotsDump() map[string]interface{} }
KubernetesBindingsController handles kubernetes bindings for one hook.
type ScheduleBindingToCrontabLink ¶
type ScheduleBindingToCrontabLink struct { BindingName string Crontab string // Useful fields to create a BindingContext IncludeSnapshots []string AllowFailure bool QueueName string Group string }
A link between a hook and a kube monitor
type ScheduleBindingsController ¶
type ScheduleBindingsController interface { WithScheduleBindings([]ScheduleConfig) WithScheduleManager(schedule_manager.ScheduleManager) EnableScheduleBindings() DisableScheduleBindings() CanHandleEvent(crontab string) bool HandleEvent(crontab string) []BindingExecutionInfo }
ScheduleBindingsController handles schedule bindings for one hook.