controllerruntime

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: EUPL-1.2 Imports: 25 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyLabels

func ApplyLabels(parent client.Object, resource client.Object, opts *LabelOpts)

func Complete

func Complete(ctx context.Context, r Reconciler, patcher *patch.SerialPatcher, o Object, opts PatchOpts) error

func ComputeReadyCondition

func ComputeReadyCondition(obj conditions.Setter, t ...string)

func CreateOrPatch

func CreateOrPatch(ctx context.Context, r Reconciler, obj client.Object, mutate controllerutil.MutateFn) error

func ExtractLabelSelector

func ExtractLabelSelector(resource client.Object) map[string]string

func FilterLabelSelector

func FilterLabelSelector(labels map[string]string) map[string]string

func Finalize

func Finalize(ctx context.Context, r Reconciler, patcher *patch.SerialPatcher, o conditions.Setter, finalize func() error) (ctrl.Result, error)

func GetLabelSelector

func GetLabelSelector(parent client.Object, opts *LabelOpts) map[string]string

func GetLabels

func GetLabels(parent client.Object, opts *LabelOpts) map[string]string

func GetResourceName

func GetResourceName(parent client.Object, suffixes ...string) string

func IsDependencyNotReady

func IsDependencyNotReady(o conditions.Getter) bool

func IsFinalizing

func IsFinalizing(o client.Object) bool

func IsHookJobNotComleted

func IsHookJobNotComleted(o conditions.Getter) bool

func IsImporting

func IsImporting(o conditions.Getter) bool

func IsJobNotComleted

func IsJobNotComleted(o conditions.Getter) bool

func LabelOwned

func LabelOwned(scheme *runtime.Scheme, owner client.Object) (handler.EventHandler, builder.Predicates)

func ObserveGenerationChange

func ObserveGenerationChange(ctx context.Context, r Reconciler, patcher *patch.SerialPatcher, o conditions.Setter) error

func OnInstall

func OnInstall(o Object, hook func() error) error

func OnUpgrade

func OnUpgrade(o Object, hook func() error) error

func Patch

func Patch(ctx context.Context, r Reconciler, patcher *patch.SerialPatcher, obj conditions.Setter, opts PatchOpts) error

func SetCurrentVersion

func SetCurrentVersion(o Object)

func SetDependencyCondition

func SetDependencyCondition(to conditions.Setter, dependencies ...Dependency)

func SetFinalize

func SetFinalize(ctx context.Context, r Reconciler, patcher *patch.SerialPatcher, o conditions.Setter) error

func SetHookJobCondition

func SetHookJobCondition(to conditions.Setter, jobs ...*batchv1.Job)

func SetResourceNamespacedName

func SetResourceNamespacedName(parent client.Object, resource client.Object, suffixes ...string)

func UnsetControllerReference

func UnsetControllerReference(ctx context.Context, r Reconciler, owner client.Object, controlled client.Object) error

Types

type Dependency

type Dependency interface {
	// client.Object
	conditions.Setter
}

type JobManager

type JobManager interface {
	Add(*batchv1.Job)
	UpdateCondition(context.Context) (bool, error)
}

func NewJobManager

func NewJobManager(reconciler Reconciler, object conditions.Setter, patcher *patch.SerialPatcher) JobManager

type LabelOpts

type LabelOpts struct {
	Component string
	Version   string
}

type Object

type Object interface {
	conditions.Setter
	version.Object
	GetSuspend() bool
	SetSuspend(bool)
}

type PatchOpts

type PatchOpts struct {
	DisableReadyCondition           bool
	ReadyNegativePolarityConditions []string
}

type Reconciler

type Reconciler interface {
	client.Client
	Name() string
	OwnedConditions() []string
}

type Result

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

func Initialize

func Initialize(ctx context.Context, r Reconciler, req ctrl.Request, o Object) (*patch.SerialPatcher, *Result)

func WrapResult

func WrapResult(result ctrl.Result, err error) *Result

func (*Result) Unwrap

func (r *Result) Unwrap() (ctrl.Result, error)

Jump to

Keyboard shortcuts

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