hooks

package
v1.18.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 14 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterAllConfig

type AfterAllConfig struct {
	CommonBindingConfig
	Order float64
}

type AfterDeleteHelmConfig

type AfterDeleteHelmConfig struct {
	CommonBindingConfig
	Order float64
}

type AfterHelmConfig

type AfterHelmConfig struct {
	CommonBindingConfig
	Order float64
}

type BeforeAllConfig

type BeforeAllConfig struct {
	CommonBindingConfig
	Order float64
}

type BeforeHelmConfig

type BeforeHelmConfig struct {
	CommonBindingConfig
	Order float64
}

type GlobalHook

type GlobalHook struct {
	// contains filtered or unexported fields
}

GlobalHook is a representation of the hook, which not belongs to any module

func NewGlobalHook

func NewGlobalHook(ex executableHookWithLoad) *GlobalHook

NewGlobalHook constructs a new global hook

ex - is an executable hook instance (GoHook or ShellHook)

func (*GlobalHook) GetConfigDescription

func (h *GlobalHook) GetConfigDescription() string

GetConfigDescription returns config description for debugging/logging

func (*GlobalHook) GetConfigVersion

func (h *GlobalHook) GetConfigVersion() string

GetConfigVersion version on the config

func (*GlobalHook) GetGoHookInputSettings

func (h *GlobalHook) GetGoHookInputSettings() *gohook.HookConfigSettings

GetGoHookInputSettings proxy method to extract GoHook config settings

func (*GlobalHook) GetHookConfig

func (h *GlobalHook) GetHookConfig() *GlobalHookConfig

GetHookConfig returns the global hook configuration

func (*GlobalHook) InitializeHookConfig

func (h *GlobalHook) InitializeHookConfig() error

InitializeHookConfig initializes the global hook config for GoHook config is precompiled, so we just have to fetch it for ShellHook, that hook will be run with `--config` flag, returns and parses the config

func (*GlobalHook) Order

func (h *GlobalHook) Order(binding shell_op_types.BindingType) float64

Order return float order number for bindings with order.

func (*GlobalHook) SynchronizationNeeded

func (h *GlobalHook) SynchronizationNeeded() bool

SynchronizationNeeded is true if there is binding with executeHookOnSynchronization.

type GlobalHookConfig

type GlobalHookConfig struct {
	config.HookConfig

	// versioned raw config values
	GlobalV0 *GlobalHookConfigV0
	GlobalV1 *GlobalHookConfigV0

	// effective config values
	BeforeAll *BeforeAllConfig
	AfterAll  *AfterAllConfig
}

GlobalHookConfig is a structure with versioned hook configuration

func (*GlobalHookConfig) Bindings

func (c *GlobalHookConfig) Bindings() []BindingType

func (*GlobalHookConfig) BindingsCount

func (c *GlobalHookConfig) BindingsCount() int

func (*GlobalHookConfig) HasBinding

func (c *GlobalHookConfig) HasBinding(binding BindingType) bool

func (*GlobalHookConfig) LoadHookConfig added in v1.6.0

func (c *GlobalHookConfig) LoadHookConfig(configLoader gohook.HookConfigLoader) error

type GlobalHookConfigV0

type GlobalHookConfigV0 struct {
	BeforeAll interface{} `json:"beforeAll"`
	AfterAll  interface{} `json:"afterAll"`
}

type HookExecutionDependencyContainer

type HookExecutionDependencyContainer struct {
	HookMetricsStorage hooksMetricsStorage
	KubeConfigManager  kubeConfigManager
	KubeObjectPatcher  kubeObjectPatcher
	MetricStorage      metricStorage
	GlobalValuesGetter globalValuesGetter
	EnvironmentManager *environmentmanager.Manager
}

HookExecutionDependencyContainer container for all hook execution dependencies

type ModuleHook

type ModuleHook struct {
	// contains filtered or unexported fields
}

ModuleHook hook which belongs to some module

func NewModuleHook

func NewModuleHook(ex executableHookWithLoad) *ModuleHook

NewModuleHook build new hook for a module

ex - some kind of executable hook (GoHook or ShellHook)

func (*ModuleHook) ApplyBindingActions

func (mh *ModuleHook) ApplyBindingActions(bindingActions []gohook.BindingAction) error

ApplyBindingActions some kind of runtime monitor bindings update

func (*ModuleHook) GetConfigDescription

func (mh *ModuleHook) GetConfigDescription() string

GetConfigDescription returns config description for debugging/logging

func (*ModuleHook) GetConfigVersion

func (mh *ModuleHook) GetConfigVersion() string

GetConfigVersion returns config version

func (*ModuleHook) GetGoHookInputSettings

func (mh *ModuleHook) GetGoHookInputSettings() *gohook.HookConfigSettings

GetGoHookInputSettings proxy method to extract GoHook config settings

func (*ModuleHook) GetHookConfig

func (mh *ModuleHook) GetHookConfig() *ModuleHookConfig

GetHookConfig returns config for the module hook, it has some difference with global hook

func (*ModuleHook) InitializeHookConfig

func (mh *ModuleHook) InitializeHookConfig() error

InitializeHookConfig initializes the global hook config for GoHook config is precompiled, so we just have to fetch it for ShellHook, that hook will be run with `--config` flag, returns and parses the config for BatchHook, that hook will be run with `hook config` args, returns and parses the config

func (*ModuleHook) Order

func (mh *ModuleHook) Order(binding shell_op_types.BindingType) float64

Order returns hook order

func (*ModuleHook) SynchronizationNeeded

func (mh *ModuleHook) SynchronizationNeeded() bool

SynchronizationNeeded is true if there is binding with executeHookOnSynchronization.

func (*ModuleHook) WithHookController

func (mh *ModuleHook) WithHookController(ctrl *controller.HookController)

WithHookController set HookController for shell-operator

func (*ModuleHook) WithTmpDir

func (mh *ModuleHook) WithTmpDir(tmpDir string)

WithTmpDir proxy method to set temp directory for the executable hook

type ModuleHookConfig

type ModuleHookConfig struct {
	config.HookConfig

	// versioned raw config values
	ModuleV0 *ModuleHookConfigV0
	ModuleV1 *ModuleHookConfigV0

	// effective config values
	BeforeHelm      *BeforeHelmConfig
	AfterHelm       *AfterHelmConfig
	AfterDeleteHelm *AfterDeleteHelmConfig
}

ModuleHookConfig is a structure with versioned hook configuration

func (*ModuleHookConfig) Bindings

func (c *ModuleHookConfig) Bindings() []BindingType

func (*ModuleHookConfig) BindingsCount

func (c *ModuleHookConfig) BindingsCount() int

func (*ModuleHookConfig) HasBinding

func (c *ModuleHookConfig) HasBinding(binding BindingType) bool

func (*ModuleHookConfig) LoadHookConfig added in v1.6.0

func (c *ModuleHookConfig) LoadHookConfig(configLoader gohook.HookConfigLoader) error

type ModuleHookConfigV0

type ModuleHookConfigV0 struct {
	BeforeHelm      interface{} `json:"beforeHelm"`
	AfterHelm       interface{} `json:"afterHelm"`
	AfterDeleteHelm interface{} `json:"afterDeleteHelm"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL