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(_ htypes.BindingType, context []bctx.BindingContext, ...) (*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) htypes.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 htypes.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 kemtypes.KubeEvent, ...)
- 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 KeepTemporaryHookFiles bool LogProxyHookJSON bool LogProxyHookJSONKey string Logger *log.Logger }
func (*Hook) GetConfig ¶
func (h *Hook) GetConfig() *config.HookConfig
func (*Hook) GetConfigDescription ¶
func (*Hook) Run ¶
func (h *Hook) Run(_ htypes.BindingType, context []bctx.BindingContext, logLabels map[string]string) (*Result, error)
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 (hm *Manager) DetectAdmissionEventType(event admission.Event) htypes.BindingType
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 (hm *Manager) GetHooksInOrder(bindingType htypes.BindingType) ([]string, error)
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 kemtypes.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 kubeeventsmanager.KubeEventsManager Smgr schedulemanager.ScheduleManager Wmgr *admission.WebhookManager Cmgr *conversion.WebhookManager Logger *log.Logger }
ManagerConfig sets configuration for Manager
Click to show internal directories.
Click to hide internal directories.