controllers

package
v0.0.0-...-c510420 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const InstrumentationName = constant.LibraryName + "/example/controllers"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMapAdmissionController

type ConfigMapAdmissionController struct {
	CtrlName        string
	Log             logr.Logger
	Client          client.Client
	DiscoveryClient discovery.DiscoveryInterface
}

func (*ConfigMapAdmissionController) Default

func (*ConfigMapAdmissionController) GetNewObject

func (cmac *ConfigMapAdmissionController) GetNewObject() client.Object

func (*ConfigMapAdmissionController) Name

func (cmac *ConfigMapAdmissionController) Name() string

func (*ConfigMapAdmissionController) RequireDefaulting

func (cmac *ConfigMapAdmissionController) RequireDefaulting(obj client.Object) bool

func (*ConfigMapAdmissionController) RequireValidating

func (cmac *ConfigMapAdmissionController) RequireValidating(obj client.Object) bool

func (*ConfigMapAdmissionController) SetupWithManager

func (cmac *ConfigMapAdmissionController) SetupWithManager(mgr manager.Manager) error

func (*ConfigMapAdmissionController) ValidateCreate

func (*ConfigMapAdmissionController) ValidateDelete

func (*ConfigMapAdmissionController) ValidateUpdate

type ExternalGameSyncReconciler

type ExternalGameSyncReconciler struct {
	client.Client
	Scheme          *runtime.Scheme
	Instrumentation *telemetry.Instrumentation

	extobjsyncv1.Reconciler
}

ExternalGameSyncReconciler reconciles a Game object to keep it in sync with the corresponding external system object.

func (*ExternalGameSyncReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type FakeCache

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

FakeCache is a cache to store event source object data.

func NewFakeCache

func NewFakeCache(log logr.Logger) *FakeCache

NewFakeCache initializes and returns a new fake cache.

func (*FakeCache) CacheMiss

func (fc *FakeCache) CacheMiss(obj client.Object) bool

CacheMiss implements external controller Cache interface. It checks for cache miss with the given object. On cache miss, it updates the cache.

func (*FakeCache) Get

func (fc *FakeCache) Get(key string) (string, bool)

Get returns the value of key in the cache if found with true boolean. If not found, an empty string is returned with a false boolean.

func (*FakeCache) Set

func (fc *FakeCache) Set(key, val string)

Set stores the given key and value in the cache.

type GameReconciler

type GameReconciler struct {
	client.Client
	Scheme          *runtime.Scheme
	Instrumentation *telemetry.Instrumentation

	compositev1.CompositeReconciler
}

GameReconciler reconciles a Game object

func (*GameReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type NamespaceRecorderReconciler

type NamespaceRecorderReconciler struct {
	client.Client
	Scheme          *runtime.Scheme
	Instrumentation *telemetry.Instrumentation

	actionv1.Reconciler
}

NamespaceRecorderReconciler reconciles Namespace objects and records them in configmaps per namespace in a target namespace. This example demonstrates usage of the stateless-action controller. For every event of a target kind, it checks if an action is needed, if needed, an action manager is built for the target object and run in a separate goroutine. The action manager ensure that the action is executed successfully. In this example, for every namespace event, an action manager is created to perform the action of recording the namespace. For every namespace, a configmap is created at a given namespace with creation timestamp data. If the record already exists, the action is not executed.

func (*NamespaceRecorderReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type PodInformer1Reconciler

type PodInformer1Reconciler struct {
	client.Client
	Scheme          *runtime.Scheme
	Instrumentation *telemetry.Instrumentation
}

PodInformer1Reconciler reconciles external object from space.

func (*PodInformer1Reconciler) Reconcile

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

func (*PodInformer1Reconciler) SetupWithManager

func (r *PodInformer1Reconciler) SetupWithManager(mgr ctrl.Manager, spaceCache cache.Cache) error

type SpaceInformer1Reconciler

type SpaceInformer1Reconciler struct {
	client.Client
	Scheme          *runtime.Scheme
	Instrumentation *telemetry.Instrumentation
}

SpaceInformer1Reconciler reconciles external object from space.

func (*SpaceInformer1Reconciler) Reconcile

func (*SpaceInformer1Reconciler) SetupWithManager

func (r *SpaceInformer1Reconciler) SetupWithManager(mgr ctrl.Manager, spaceCache cache.Cache) error

type SpaceInformer2Reconciler

type SpaceInformer2Reconciler struct {
	client.Client
	Scheme          *runtime.Scheme
	Instrumentation *telemetry.Instrumentation
}

SpaceInformer2Reconciler reconciles external object from space.

func (*SpaceInformer2Reconciler) Reconcile

func (*SpaceInformer2Reconciler) SetupWithManager

func (r *SpaceInformer2Reconciler) SetupWithManager(mgr ctrl.Manager, spaceCache cache.Cache) error

type SpaceReconciler

type SpaceReconciler struct {
	client.Client
	Scheme          *runtime.Scheme
	Instrumentation *telemetry.Instrumentation

	// Cache is the external object cache. The data obtained from space is
	// stored in the cache. This is also used by the event handler to determine
	// if an object should be reconciled or not.
	Cache *FakeCache
}

SpaceReconciler reconciles external object from space.

func (*SpaceReconciler) Reconcile

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

Reconcile is part of the main space reconciles loop which aims to move the current state of the cluster closer to the desired state.

func (*SpaceReconciler) SetupWithManager

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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