core

package
v0.0.0-...-92ba5c8 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewRandomSecretComponent func(string, ...string) Component

Avoid an import loop. Sighs in Go.

View Source
var NewReadyStatusComponent func(...string) Component
View Source
var NewTemplateComponent func(string, string) Component

Functions

func GetConditionsFor

func GetConditionsFor(obj client.Object) (*[]conditions.Condition, error)

func NewConditionsHelper

func NewConditionsHelper(obj client.Object) *conditionsHelper

Types

type Component

type Component interface {
	Reconcile(*Context) (Result, error)
}

type ConditionsObject

type ConditionsObject interface {
	GetConditions() *[]conditions.Condition
}

type Context

type Context struct {
	context.Context
	Object         client.Object
	Client         client.Client
	UncachedClient client.Client
	Log            logr.Logger

	// Templates filesystem, mostly used through helpers but accessible directly too.
	Templates http.FileSystem
	// Name to use as the field manager with Apply.
	FieldManager string
	// API Scheme for use with other helpers.
	Scheme *runtime.Scheme
	// Arbitrary data used to communicate between components during a reconcile.
	Data ContextData
	// Event recorder to emit event objects.
	Events record.EventRecorder
	// Helper for setting status conditions.
	Conditions *conditionsHelper
	// contains filtered or unexported fields
}

type ContextData

type ContextData map[string]interface{}

func (ContextData) GetString

func (d ContextData) GetString(key string) (string, bool)

type FinalizerComponent

type FinalizerComponent interface {
	Finalize(*Context) (Result, bool, error)
}

type InitializerComponent

type InitializerComponent interface {
	Setup(*Context, *ctrl.Builder) error
}

type ReadyConditionComponent

type ReadyConditionComponent interface {
	GetReadyCondition() string
}

type Reconciler

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

func NewReconciler

func NewReconciler(mgr ctrl.Manager) *Reconciler

func (*Reconciler) Build

func (r *Reconciler) Build() (controller.Controller, error)

func (*Reconciler) Complete

func (r *Reconciler) Complete() error

func (*Reconciler) Component

func (r *Reconciler) Component(name string, comp Component) *Reconciler

func (*Reconciler) For

func (r *Reconciler) For(apiType client.Object, opts ...builder.ForOption) *Reconciler

func (*Reconciler) RandomSecretComponent

func (r *Reconciler) RandomSecretComponent(keys ...string) *Reconciler

func (*Reconciler) ReadyStatusComponent

func (r *Reconciler) ReadyStatusComponent(keys ...string) *Reconciler

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*Reconciler) TemplateComponent

func (r *Reconciler) TemplateComponent(template string, conditionType string) *Reconciler

func (*Reconciler) Templates

func (r *Reconciler) Templates(t http.FileSystem) *Reconciler

func (*Reconciler) Watches

func (r *Reconciler) Watches(src source.Source, eventhandler handler.EventHandler, opts ...builder.WatchesOption) *Reconciler

func (*Reconciler) Webhook

func (r *Reconciler) Webhook() *Reconciler

type Result

type Result struct {
	Requeue       bool
	RequeueAfter  time.Duration
	SkipRemaining bool
}

Jump to

Keyboard shortcuts

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