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 Object) (*[]conditions.Condition, error)

    func NewConditionsHelper

    func NewConditionsHelper(obj 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         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 Object

    type Object interface {
    	metav1.Object
    	runtime.Object
    	controllerutil.Object
    }

      An object that implements all the main object APIs, to avoid needing to cast so much. Idea borrowed from controller-runtime, but with ObjectKind added too.

      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 runtime.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(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) Webhook

      func (r *Reconciler) Webhook() *Reconciler

      type Result

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