Documentation
¶
Index ¶
- Variables
- func Bool(b bool) *bool
- func BoolDeref(ptr *bool, def bool) bool
- type BindingAction
- type FilterFunc
- type FilterResult
- type GoHook
- type HookBindingContext
- type HookConfig
- type HookConfigLoader
- type HookConfigSettings
- type HookInput
- type HookMetadata
- type KubernetesConfig
- type Logger
- type OrderedConfig
- type PatchCollector
- type ScheduleConfig
- type Snapshots
- type Wrapped
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyWrapped = errors.New("empty filter result") ErrUnmarshalToTypesNotMatch = errors.New("input and output types not match") )
Functions ¶
Types ¶
type BindingAction ¶
type FilterFunc ¶
type FilterFunc func(*unstructured.Unstructured) (FilterResult, error)
type FilterResult ¶
type FilterResult any
type HookBindingContext ¶
type HookBindingContext struct {
// Type of binding context: [Event, Synchronization, Group, Schedule]
Type string
// Binding is a related binding name.
Binding string
// Snapshots contain all objects for all bindings.
Snapshots map[string][]types.ObjectAndFilterResult
}
type HookConfig ¶
type HookConfig struct {
Schedule []ScheduleConfig
Kubernetes []KubernetesConfig
// OnStartup runs hook on module/global startup
// Attention! During the startup you don't have snapshots available
// use native KubeClient to fetch resources
OnStartup *OrderedConfig
OnBeforeHelm *OrderedConfig
OnAfterHelm *OrderedConfig
OnAfterDeleteHelm *OrderedConfig
OnBeforeAll *OrderedConfig
OnAfterAll *OrderedConfig
AllowFailure bool
Queue string
Settings *HookConfigSettings
Logger *log.Logger
}
type HookConfigLoader ¶ added in v1.6.0
type HookConfigSettings ¶
type HookInput ¶
type HookInput struct {
Snapshots sdkpkg.Snapshots
Values sdkpkg.PatchableValuesCollector
ConfigValues sdkpkg.PatchableValuesCollector
MetricsCollector sdkpkg.MetricsCollector
PatchCollector PatchCollector
Logger Logger
BindingActions *[]BindingAction
}
type HookMetadata ¶
type KubernetesConfig ¶
type KubernetesConfig struct {
// Name is a key in snapshots map.
Name string
// ApiVersion of objects. "v1" is used if not set.
ApiVersion string
// Kind of objects.
Kind string
// NameSelector used to subscribe on object by its name.
NameSelector *types.NameSelector
// NamespaceSelector used to subscribe on objects in namespaces.
NamespaceSelector *types.NamespaceSelector
// LabelSelector used to subscribe on objects by matching their labels.
LabelSelector *v1.LabelSelector
// FieldSelector used to subscribe on objects by matching specific fields (the list of fields is narrow, see shell-operator documentation).
FieldSelector *types.FieldSelector
// ExecuteHookOnEvents is true by default. Set to false if only snapshot update is needed.
ExecuteHookOnEvents *bool
// ExecuteHookOnSynchronization is true by default. Set to false if only snapshot update is needed.
ExecuteHookOnSynchronization *bool
// WaitForSynchronization is true by default. Set to false if beforeHelm is not required this snapshot on start.
WaitForSynchronization *bool
// FilterFunc used to filter object content for snapshot. Addon-operator use checksum of this filtered result to ignore irrelevant events.
FilterFunc FilterFunc
}
type Logger ¶ added in v1.6.0
type Logger interface {
sdkpkg.Logger
// Deprecated: use Debug instead
Debugf(format string, args ...any)
// Deprecated: use Error instead
Errorf(format string, args ...any)
// Deprecated: use Fatal instead
Fatalf(format string, args ...any)
// Deprecated: use Info instead
Infof(format string, args ...any)
// Deprecated: use Log instead
Logf(ctx context.Context, level log.Level, format string, args ...any)
// Deprecated: use Warn instead
Warnf(format string, args ...any)
}
type OrderedConfig ¶
type OrderedConfig struct {
Order float64
}
type PatchCollector ¶ added in v1.6.0
type PatchCollector interface {
sdkpkg.PatchCollector
PatchWithMutatingFunc(fn func(*unstructured.Unstructured) (*unstructured.Unstructured, error), apiVersion string, kind string, namespace string, name string, opts ...sdkpkg.PatchCollectorOption)
}
type ScheduleConfig ¶
Click to show internal directories.
Click to hide internal directories.