controllers

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MaxConcurrentReconciles = 3

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUpdateReconciler

type CreateUpdateReconciler struct {
	PodReconciler            *PodReconciler
	CreateUpdateEventChannel chan event.GenericEvent
}

CreateUpdateReconciler to handle create and update events on the pod objects

func (*CreateUpdateReconciler) Reconcile

func (r *CreateUpdateReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

Reconcile handles create and update events

func (*CreateUpdateReconciler) SetupWithManager

func (c *CreateUpdateReconciler) SetupWithManager(manager ctrl.Manager) error

SetupWithManager sets controller to listen on the create events and update events

type DeleteReconciler

type DeleteReconciler struct {
	PodReconciler      *PodReconciler
	DeleteEventChannel chan event.GenericEvent
}

DeleteReconciler to handle the delete events on pod objects

func (*DeleteReconciler) Reconcile

func (d *DeleteReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

Reconcile handles delete events

func (*DeleteReconciler) SetupWithManager

func (d *DeleteReconciler) SetupWithManager(manager ctrl.Manager) error

SetupWithManager sets controller to listen on the delete events

type NodeReconciler

type NodeReconciler struct {
	client.Client
	Log     logr.Logger
	Scheme  *runtime.Scheme
	Manager node.Manager
}

NodeReconciler reconciles a Node object

func (*NodeReconciler) Reconcile

func (r *NodeReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*NodeReconciler) SetupWithManager

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

type PodReconciler

type PodReconciler struct {
	Log logr.Logger
	// Handlers is the resource handler for handling supported request on specified in the
	// container requests.
	Handlers []reqHandler.Handler
	// Manager manages all the nodes on the cluster
	Manager node.Manager
	// PodController to get the cached data store
	PodController custom.Controller
}

func (*PodReconciler) ProcessEvent

func (r *PodReconciler) ProcessEvent(req ctrl.Request, isDeleteEvent bool) (ctrl.Result, error)

ProcessEvent handles create/update event by querying the handler if it can process container request and pass the pod to the handler if it is capable of handling the request. The Delete event passes the pod object to supported handlers to clean up the resources and remove the entry from the data store.

Jump to

Keyboard shortcuts

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