executor

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// Config returns the hook's configuration as HookConfigLike (*HookConfig or *ApplicationHookConfig).
	Config() pkg.HookConfigInterface
	// Execute runs the hook logic and returns collected results.
	Execute(ctx context.Context, req Request) (Result, error)
}

Executor runs a hook with the provided request and returns results. Implemented by moduleExecutor and applicationExecutor.

func NewApplicationExecutor

func NewApplicationExecutor(h pkg.Hook[pkg.ApplicationHookConfig, *pkg.ApplicationHookInput], logger *log.Logger) Executor

NewApplicationExecutor creates a new application executor

func NewModuleExecutor

func NewModuleExecutor(h pkg.Hook[pkg.HookConfig, *pkg.HookInput], logger *log.Logger) Executor

NewModuleExecutor creates a new module hook executor

type Request

type Request interface {
	// GetValues returns the current module values.
	GetValues() (map[string]any, error)
	// GetConfigValues returns the module's ConfigMap values.
	GetConfigValues() (map[string]any, error)
	// GetBindingContexts returns Kubernetes binding contexts with snapshots.
	GetBindingContexts() ([]bctx.BindingContext, error)
	// GetDependencyContainer returns the container with external dependencies.
	GetDependencyContainer() pkg.DependencyContainer
}

Request provides input data for hook execution. Implemented by transport layer (e.g., file transport).

type Result

type Result interface {
	// MetricsCollector returns collected Prometheus metrics.
	MetricsCollector() pkg.Outputer
	// ObjectPatchCollector returns collected Kubernetes object patches.
	ObjectPatchCollector() pkg.Outputer
	// ValuesPatchCollector returns collected values patches by type.
	ValuesPatchCollector(key utils.ValuesPatchType) pkg.Outputer
}

Result contains outputs collected during hook execution. Used by transport layer to send results back to shell-operator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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