hooks

package
v1.60.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteSuccessfully

func ExecuteSuccessfully() types.GomegaMatcher

func JoinKubeResources

func JoinKubeResources(resources ...string) string

func JoinKubeResourcesAndSet

func JoinKubeResourcesAndSet(f *HookExecutionConfig, resources ...string)

func SimpleBindingGeneratedBindingContext

func SimpleBindingGeneratedBindingContext(binding BindingType) context.GeneratedBindingContexts

SimpleBindingGeneratedBindingContext is a helper to create empty binding contexts for OnStartup/Schedule/AfterHelm/etc.

func TempDirWithPerms

func TempDirWithPerms(dir, prefix string, perms int) (name string, err error)

func TempFileWithPerms

func TempFileWithPerms(dir, pattern string, perms int) (f *os.File, err error)

Types

type BindingContextsSlice

type BindingContextsSlice struct {
	JSON            string
	BindingContexts []binding_context.BindingContext
}

func (*BindingContextsSlice) Array

func (bcs *BindingContextsSlice) Array() []gjson.Result

func (*BindingContextsSlice) Get

func (*BindingContextsSlice) Parse

func (*BindingContextsSlice) Set

func (*BindingContextsSlice) String

func (bcs *BindingContextsSlice) String() string

type CustomCRD

type CustomCRD struct {
	Group      string
	Version    string
	Kind       string
	Namespaced bool
}

type HookExecutionConfig

type HookExecutionConfig struct {
	HookPath string
	GoHook   *kind.GoHook

	KubeExtraCRDs            []CustomCRD
	IsKubeStateInited        bool
	BindingContexts          BindingContextsSlice
	BindingContextController *hookcontext.BindingContextController

	ValuesValidator      *values_validation.ValuesValidator
	GoHookError          error
	GoHookBindingActions []go_hook.BindingAction

	MetricsCollector TestMetricsCollector
	PatchCollector   *object_patch.PatchCollector

	Session      *gexec.Session
	LogrusOutput *gbytes.Buffer
	// contains filtered or unexported fields
}

func HookExecutionConfigInit

func HookExecutionConfigInit(initValues, initConfigValues string, k8sVersion ...k8s.FakeClusterVersion) *HookExecutionConfig

func (*HookExecutionConfig) AddHookEnv

func (hec *HookExecutionConfig) AddHookEnv(env string)

func (*HookExecutionConfig) ConfigValuesDelete

func (hec *HookExecutionConfig) ConfigValuesDelete(path string)

func (*HookExecutionConfig) ConfigValuesGet

func (hec *HookExecutionConfig) ConfigValuesGet(path string) library.KubeResult

func (*HookExecutionConfig) ConfigValuesSet

func (hec *HookExecutionConfig) ConfigValuesSet(path string, value interface{})

func (*HookExecutionConfig) ConfigValuesSetFromYaml

func (hec *HookExecutionConfig) ConfigValuesSetFromYaml(path string, value []byte)

func (*HookExecutionConfig) GenerateAfterAllContext

func (hec *HookExecutionConfig) GenerateAfterAllContext() hookcontext.GeneratedBindingContexts

GenerateAfterAllContext returns binding context for afterAll binding with all available snapshots.

func (*HookExecutionConfig) GenerateAfterDeleteHelmContext

func (hec *HookExecutionConfig) GenerateAfterDeleteHelmContext() hookcontext.GeneratedBindingContexts

GenerateAfterDeleteHelmContext returns binding context for afterDeleteHelm binding with all available snapshots.

func (*HookExecutionConfig) GenerateAfterHelmContext

func (hec *HookExecutionConfig) GenerateAfterHelmContext() hookcontext.GeneratedBindingContexts

GenerateAfterHelmContext returns binding context for afterHelm binding with all available snapshots.

func (*HookExecutionConfig) GenerateBeforeAllContext

func (hec *HookExecutionConfig) GenerateBeforeAllContext() hookcontext.GeneratedBindingContexts

GenerateBeforeAllContext returns binding context for beforeAll binding with all available snapshots.

func (*HookExecutionConfig) GenerateBeforeHelmContext

func (hec *HookExecutionConfig) GenerateBeforeHelmContext() hookcontext.GeneratedBindingContexts

GenerateBeforeHelmContext returns binding context for beforeHelm binding with all available snapshots.

func (*HookExecutionConfig) GenerateOnStartupContext

func (hec *HookExecutionConfig) GenerateOnStartupContext() hookcontext.GeneratedBindingContexts

GenerateOnStartupContext returns binding context for OnStartup.

func (*HookExecutionConfig) GenerateScheduleContext

func (hec *HookExecutionConfig) GenerateScheduleContext(crontab string) hookcontext.GeneratedBindingContexts

GenerateScheduleContext returns binding context for Schedule with needed snapshots.

func (*HookExecutionConfig) KubeClient

func (hec *HookExecutionConfig) KubeClient() *klient.Client

func (*HookExecutionConfig) KubeStateSet

func (hec *HookExecutionConfig) KubeStateSet(newKubeState string) hookcontext.GeneratedBindingContexts

func (*HookExecutionConfig) KubeStateSetAndWaitForBindingContexts

func (hec *HookExecutionConfig) KubeStateSetAndWaitForBindingContexts(newKubeState string, _ int) hookcontext.GeneratedBindingContexts

func (*HookExecutionConfig) KubernetesGlobalResource

func (hec *HookExecutionConfig) KubernetesGlobalResource(kind, name string) object_store.KubeObject

func (*HookExecutionConfig) KubernetesResource

func (hec *HookExecutionConfig) KubernetesResource(kind, namespace, name string) object_store.KubeObject

func (*HookExecutionConfig) RegisterCRD

func (hec *HookExecutionConfig) RegisterCRD(group, version, kind string, namespaced bool)

func (*HookExecutionConfig) RunGoHook

func (hec *HookExecutionConfig) RunGoHook()

func (*HookExecutionConfig) RunHook

func (hec *HookExecutionConfig) RunHook()

func (*HookExecutionConfig) ValuesDelete

func (hec *HookExecutionConfig) ValuesDelete(path string)

func (*HookExecutionConfig) ValuesGet

func (hec *HookExecutionConfig) ValuesGet(path string) library.KubeResult

func (*HookExecutionConfig) ValuesSet

func (hec *HookExecutionConfig) ValuesSet(path string, value interface{})

func (*HookExecutionConfig) ValuesSetFromYaml

func (hec *HookExecutionConfig) ValuesSetFromYaml(path string, value []byte)

type ShellOperatorHookConfig

type ShellOperatorHookConfig struct {
	ConfigVersion interface{} `json:"configVersion,omitempty"`
	Kubernetes    interface{} `json:"kubernetes,omitempty"`
	Schedule      interface{} `json:"schedule,omitempty"`
}

type TestMetricsCollector

type TestMetricsCollector interface {
	CollectedMetrics() []operation.MetricOperation
}

Jump to

Keyboard shortcuts

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