Documentation ¶
Index ¶
- Variables
- type KubeEvent
- type KubeEventsInformer
- func (ei *KubeEventsInformer) HandleKubeEvent(obj interface{}, kind string, newChecksum string, eventType string, ...) error
- func (ei *KubeEventsInformer) InitializeItemsList(list runtime.Object, debug bool) error
- func (ei *KubeEventsInformer) Run()
- func (ei *KubeEventsInformer) ShouldHandleEvent(checkEvent OnKubernetesEventType) bool
- func (ei *KubeEventsInformer) Stop()
- type KubeEventsManager
- type KubeNamespaceSelector
- type MainKubeEventsManager
- type OnKubernetesEventConfig
- type OnKubernetesEventType
Constants ¶
This section is empty.
Variables ¶
View Source
var (
KubeEventCh chan KubeEvent
)
Functions ¶
This section is empty.
Types ¶
type KubeEventsInformer ¶
type KubeEventsInformer struct { ConfigId string Kind string EventTypes []OnKubernetesEventType JqFilter string Checksum map[string]string }
func NewKubeEventsInformer ¶
func NewKubeEventsInformer() *KubeEventsInformer
func (*KubeEventsInformer) HandleKubeEvent ¶
func (ei *KubeEventsInformer) HandleKubeEvent(obj interface{}, kind string, newChecksum string, eventType string, sendSignal bool, debug bool) error
HandleKubeEvent sends new KubeEvent to KubeEventCh obj doesn't contains Kind information, so kind is passed from Run() argument. TODO refactor: pass KubeEvent as argument TODO add delay to merge Added and Modified events (node added and then labels applied — one hook run on Added+Modifed is enough)
func (*KubeEventsInformer) InitializeItemsList ¶
func (ei *KubeEventsInformer) InitializeItemsList(list runtime.Object, debug bool) error
func (*KubeEventsInformer) Run ¶
func (ei *KubeEventsInformer) Run()
func (*KubeEventsInformer) ShouldHandleEvent ¶
func (ei *KubeEventsInformer) ShouldHandleEvent(checkEvent OnKubernetesEventType) bool
func (*KubeEventsInformer) Stop ¶
func (ei *KubeEventsInformer) Stop()
type KubeEventsManager ¶
type KubeEventsManager interface { Run(eventTypes []OnKubernetesEventType, kind, namespace string, labelSelector *metaV1.LabelSelector, jqFilter string, debug bool) (string, error) Stop(configId string) error }
func Init ¶
func Init() (KubeEventsManager, error)
type KubeNamespaceSelector ¶
type MainKubeEventsManager ¶
type MainKubeEventsManager struct {
KubeEventsInformersByConfigId map[string]*KubeEventsInformer
}
func NewMainKubeEventsManager ¶
func NewMainKubeEventsManager() *MainKubeEventsManager
func (*MainKubeEventsManager) Run ¶
func (em *MainKubeEventsManager) Run(eventTypes []OnKubernetesEventType, kind, namespace string, labelSelector *metaV1.LabelSelector, jqFilter string, debug bool) (string, error)
func (*MainKubeEventsManager) Stop ¶
func (em *MainKubeEventsManager) Stop(configId string) error
type OnKubernetesEventConfig ¶
type OnKubernetesEventConfig struct { Name string `json:"name"` EventTypes []OnKubernetesEventType `json:"event"` Kind string `json:"kind"` Selector *metav1.LabelSelector `json:"selector"` NamespaceSelector *KubeNamespaceSelector `json:"namespaceSelector"` JqFilter string `json:"jqFilter"` AllowFailure bool `json:"allowFailure"` DisableDebug bool `json:"disableDebug"` }
type OnKubernetesEventType ¶
type OnKubernetesEventType string
const ( KubernetesEventOnAdd OnKubernetesEventType = "add" KubernetesEventOnUpdate OnKubernetesEventType = "update" KubernetesEventOnDelete OnKubernetesEventType = "delete" )
Click to show internal directories.
Click to hide internal directories.