controllers

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddManagerIndices

func AddManagerIndices(indexer client.FieldIndexer) error

AddManagerIndices adds the needed manager indices for faster listing of resources

func RBACGenerateName

func RBACGenerateName(account *configv1alpha1.Account) string

func Register

func Register(mgr manager.Manager) error

Register registers the webhooks to the manager

func ResyncPeriod

func ResyncPeriod() func() time.Duration

ResyncPeriod returns a function which generates a duration each time it is invoked; this is so that multiple controllers don't get into lock-step and all hammer the apiserver with list requests simultaneously.

Types

type AccountReconciler

type AccountReconciler struct {
	client.Client
	Log    loghelper.Logger
	Scheme *runtime.Scheme
}

AccountReconciler reconciles a Account object

func (*AccountReconciler) Reconcile

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

Reconcile reads that state of the cluster for an Account object and makes changes based on the state read

func (*AccountReconciler) SetupWithManager

func (r *AccountReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager adds the controller to the manager

type Context

type Context struct {
	// The controller runtime manager
	Manager manager.Manager

	// The global stop chan
	StopChan <-chan struct{}

	// SharedInformers is a generic shared informer factory that is used by multiple controller together, informers
	// stored here are different from informers in the controller-runtime manager, which should be preferred if possible
	SharedInformers informers.SharedInformerFactory

	// ObjectOrMetadataInformers creates generic informers for each group version resource
	ObjectOrMetadataInformers controller.InformerFactory

	// InformersStarted is closed as soon as the informer factories were started
	InformersStarted chan struct{}

	// DiscoveryFunc is able to discover available api resources in the cluster
	DiscoveryFunc func() ([]*metav1.APIResourceList, error)
}

Context holds informations for native kubernetes controllers that need access to a sharedindexfactory

func NewControllerContext

func NewControllerContext(mgr manager.Manager, stopChan <-chan struct{}) *Context

NewControllerContext creates a new controller context

func (*Context) Start

func (c *Context) Start()

Start starts the informer factories

type NamespaceEventHandler

type NamespaceEventHandler struct {
	Log logr.Logger
}

NamespaceEventHandler handles events

func (*NamespaceEventHandler) Create

Create implements EventHandler

func (*NamespaceEventHandler) Delete

Delete implements EventHandler

func (*NamespaceEventHandler) Generic

Generic implements EventHandler

func (*NamespaceEventHandler) Update

Update implements EventHandler

type TemplateInstanceReconciler

type TemplateInstanceReconciler struct {
	client.Client

	Log    loghelper.Logger
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

TemplateInstanceReconciler reconciles a template instance object

func (*TemplateInstanceReconciler) Reconcile

Reconcile reads that state of the cluster for an Account object and makes changes based on the state read

func (*TemplateInstanceReconciler) SetupWithManager

func (r *TemplateInstanceReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager adds the controller to the manager

Jump to

Keyboard shortcuts

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