Documentation ¶
Index ¶
- func CreateRateLimiter(cfg *config.HookConfig) *rate.Limiter
- type CommonHook
- type Hook
- func (h *Hook) GetConfig() *config.HookConfig
- func (h *Hook) GetConfigDescription() string
- func (h *Hook) LoadConfig(configOutput []byte) (hook *Hook, err error)
- func (h *Hook) RateLimitWait(ctx context.Context) error
- func (h *Hook) Run(_ BindingType, context []BindingContext, logLabels map[string]string) (*Result, error)
- func (h *Hook) SafeName() string
- func (h *Hook) WithHookController(hookController *controller.HookController)
- func (h *Hook) WithTmpDir(dir string)
- type Manager
- func (hm *Manager) DetectAdmissionEventType(event admission.Event) BindingType
- func (hm *Manager) FindConversionChain(crdName string, rule conversion.Rule) []conversion.Rule
- func (hm *Manager) GetHook(name string) *Hook
- func (hm *Manager) GetHookNames() []string
- func (hm *Manager) GetHooksInOrder(bindingType BindingType) ([]string, error)
- func (hm *Manager) HandleAdmissionEvent(event admission.Event, ...)
- func (hm *Manager) HandleConversionEvent(crdName string, request *v1.ConversionRequest, rule conversion.Rule, ...)
- func (hm *Manager) HandleKubeEvent(kubeEvent KubeEvent, createTaskFn func(*Hook, controller.BindingExecutionInfo))
- func (hm *Manager) HandleScheduleEvent(crontab string, createTaskFn func(*Hook, controller.BindingExecutionInfo))
- func (hm *Manager) Init() error
- func (hm *Manager) TempDir() string
- func (hm *Manager) UpdateConversionChains() error
- func (hm *Manager) WorkingDir() string
- type ManagerConfig
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRateLimiter ¶
func CreateRateLimiter(cfg *config.HookConfig) *rate.Limiter
Types ¶
type CommonHook ¶
type CommonHook interface {
Name() string
}
type Hook ¶
type Hook struct { Name string // The unique name like '002-prometheus-hooks/startup_hook'. Path string // The absolute path to the executable file. Config *config.HookConfig HookController *controller.HookController RateLimiter *rate.Limiter TmpDir string }
func (*Hook) GetConfig ¶
func (h *Hook) GetConfig() *config.HookConfig
func (*Hook) GetConfigDescription ¶
func (*Hook) WithHookController ¶
func (h *Hook) WithHookController(hookController *controller.HookController)
func (*Hook) WithTmpDir ¶
type Manager ¶ added in v1.4.12
type Manager struct {
// contains filtered or unexported fields
}
func NewHookManager ¶
func NewHookManager(config *ManagerConfig) *Manager
func (*Manager) DetectAdmissionEventType ¶ added in v1.4.12
func (*Manager) FindConversionChain ¶ added in v1.4.12
func (hm *Manager) FindConversionChain(crdName string, rule conversion.Rule) []conversion.Rule
func (*Manager) GetHookNames ¶ added in v1.4.12
func (*Manager) GetHooksInOrder ¶ added in v1.4.12
func (*Manager) HandleAdmissionEvent ¶ added in v1.4.12
func (hm *Manager) HandleAdmissionEvent(event admission.Event, createTaskFn func(*Hook, controller.BindingExecutionInfo))
func (*Manager) HandleConversionEvent ¶ added in v1.4.12
func (hm *Manager) HandleConversionEvent(crdName string, request *v1.ConversionRequest, rule conversion.Rule, createTaskFn func(*Hook, controller.BindingExecutionInfo))
HandleConversionEvent receives a crdName and calculates a sequence of hooks to run.
func (*Manager) HandleKubeEvent ¶ added in v1.4.12
func (hm *Manager) HandleKubeEvent(kubeEvent KubeEvent, createTaskFn func(*Hook, controller.BindingExecutionInfo))
func (*Manager) HandleScheduleEvent ¶ added in v1.4.12
func (hm *Manager) HandleScheduleEvent(crontab string, createTaskFn func(*Hook, controller.BindingExecutionInfo))
func (*Manager) Init ¶ added in v1.4.12
Init finds executables in WorkingDir, execute them with --config argument and add them into indices.
func (*Manager) UpdateConversionChains ¶ added in v1.4.12
func (*Manager) WorkingDir ¶ added in v1.4.12
type ManagerConfig ¶ added in v1.4.12
type ManagerConfig struct { WorkingDir string TempDir string Kmgr kube_events_manager.KubeEventsManager Smgr schedule_manager.ScheduleManager Wmgr *admission.WebhookManager Cmgr *conversion.WebhookManager }
ManagerConfig sets configuration for Manager
Click to show internal directories.
Click to hide internal directories.