hooks

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 22 Imported by: 4

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 executableHook) *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() *go_hook.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() (err 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) ConvertAfterAll

func (c *GlobalHookConfig) ConvertAfterAll(value interface{}) (*AfterAllConfig, error)

func (*GlobalHookConfig) ConvertAndCheck

func (c *GlobalHookConfig) ConvertAndCheck(data []byte) error

func (*GlobalHookConfig) ConvertAndCheckV0

func (c *GlobalHookConfig) ConvertAndCheckV0() (err error)

func (*GlobalHookConfig) ConvertAndCheckV1

func (c *GlobalHookConfig) ConvertAndCheckV1() (err error)

func (*GlobalHookConfig) ConvertBeforeAll

func (c *GlobalHookConfig) ConvertBeforeAll(value interface{}) (*BeforeAllConfig, error)

func (*GlobalHookConfig) HasBinding

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

func (*GlobalHookConfig) LoadAndValidateGoConfig

func (c *GlobalHookConfig) LoadAndValidateGoConfig(input *go_hook.HookConfig) error

func (*GlobalHookConfig) LoadAndValidateShellConfig

func (c *GlobalHookConfig) LoadAndValidateShellConfig(data []byte) error

LoadAndValidateShellConfig loads shell hook config from bytes and validate it. Returns multierror.

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
}

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 executableHook) *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 []go_hook.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() *go_hook.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() (err 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 (*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) ConvertAfterDeleteHelm

func (c *ModuleHookConfig) ConvertAfterDeleteHelm(value interface{}) (*AfterDeleteHelmConfig, error)

func (*ModuleHookConfig) ConvertAfterHelm

func (c *ModuleHookConfig) ConvertAfterHelm(value interface{}) (*AfterHelmConfig, error)

func (*ModuleHookConfig) ConvertAndCheck

func (c *ModuleHookConfig) ConvertAndCheck(data []byte) error

func (*ModuleHookConfig) ConvertAndCheckV0

func (c *ModuleHookConfig) ConvertAndCheckV0() (err error)

func (*ModuleHookConfig) ConvertAndCheckV1

func (c *ModuleHookConfig) ConvertAndCheckV1() (err error)

func (*ModuleHookConfig) ConvertBeforeHelm

func (c *ModuleHookConfig) ConvertBeforeHelm(value interface{}) (*BeforeHelmConfig, error)

func (*ModuleHookConfig) HasBinding

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

func (*ModuleHookConfig) LoadAndValidateGoConfig

func (c *ModuleHookConfig) LoadAndValidateGoConfig(input *go_hook.HookConfig) error

func (*ModuleHookConfig) LoadAndValidateShellConfig

func (c *ModuleHookConfig) LoadAndValidateShellConfig(data []byte) error

LoadAndValidateShellConfig loads shell hook config from bytes and validate it. Returns multierror.

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