controllerruntime

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: EUPL-1.2 Imports: 32 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 GetVersion added in v1.0.0

func GetVersion(o ObjectVersioned) string

func InitKey

func InitKey(data map[string][]byte, key 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 MakeAnnotationsIfNil added in v1.0.0

func MakeAnnotationsIfNil(o client.Object)

func ObserveGenerationChange

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

func OnInstall

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

func OnUpgrade

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

func Patch

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

func ReconcileGenericIngress added in v1.0.0

func ReconcileGenericIngress(ctx context.Context, r Reconciler, o client.Object, host string, extraAnnotations map[string]string) (*netv1.Ingress, error)

func ReconcileGenericPostgres added in v1.0.0

func ReconcileGenericPostgres(ctx context.Context, r Reconciler, o client.Object, database string) (*lshcore.Postgres, error)

func ReconcileGenericService added in v1.0.0

func ReconcileGenericService(ctx context.Context, r Reconciler, o client.Object) (*corev1.Service, error)

func SetCurrentVersion

func SetCurrentVersion(o ObjectVersioned)

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 SetWorkloadCondition added in v1.0.0

func SetWorkloadCondition(to conditions.Setter, workloads ...client.Object) error

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 ObjectVersioned

type ObjectVersioned interface {
	Object
	version.Object
}

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