Documentation ¶
Index ¶
- Constants
- type ConfigMapAdmissionController
- func (cmac *ConfigMapAdmissionController) Default() []tkadmission.DefaultFunc
- func (cmac *ConfigMapAdmissionController) GetNewObject() client.Object
- func (cmac *ConfigMapAdmissionController) Name() string
- func (cmac *ConfigMapAdmissionController) RequireDefaulting(obj client.Object) bool
- func (cmac *ConfigMapAdmissionController) RequireValidating(obj client.Object) bool
- func (cmac *ConfigMapAdmissionController) SetupWithManager(mgr manager.Manager) error
- func (cmac *ConfigMapAdmissionController) ValidateCreate() []tkadmission.ValidateCreateFunc
- func (cmac *ConfigMapAdmissionController) ValidateDelete() []tkadmission.ValidateDeleteFunc
- func (cmac *ConfigMapAdmissionController) ValidateUpdate() []tkadmission.ValidateUpdateFunc
- type ExternalGameSyncReconciler
- type FakeCache
- type GameReconciler
- type NamespaceRecorderReconciler
- type PodInformer1Reconciler
- type SpaceInformer1Reconciler
- type SpaceInformer2Reconciler
- type SpaceReconciler
Constants ¶
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 NewConfigMapAdmissionController ¶
func NewConfigMapAdmissionController(name string, cli client.Client, dc discovery.DiscoveryInterface, log logr.Logger) *ConfigMapAdmissionController
func (*ConfigMapAdmissionController) Default ¶
func (cmac *ConfigMapAdmissionController) Default() []tkadmission.DefaultFunc
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 (cmac *ConfigMapAdmissionController) ValidateCreate() []tkadmission.ValidateCreateFunc
func (*ConfigMapAdmissionController) ValidateDelete ¶
func (cmac *ConfigMapAdmissionController) ValidateDelete() []tkadmission.ValidateDeleteFunc
func (*ConfigMapAdmissionController) ValidateUpdate ¶
func (cmac *ConfigMapAdmissionController) ValidateUpdate() []tkadmission.ValidateUpdateFunc
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 ¶
NewFakeCache initializes and returns a new fake cache.
func (*FakeCache) CacheMiss ¶
CacheMiss implements external controller Cache interface. It checks for cache miss with the given object. On cache miss, it updates 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) SetupWithManager ¶
type SpaceInformer1Reconciler ¶
type SpaceInformer1Reconciler struct { client.Client Scheme *runtime.Scheme Instrumentation *telemetry.Instrumentation }
SpaceInformer1Reconciler reconciles external object from space.
func (*SpaceInformer1Reconciler) SetupWithManager ¶
type SpaceInformer2Reconciler ¶
type SpaceInformer2Reconciler struct { client.Client Scheme *runtime.Scheme Instrumentation *telemetry.Instrumentation }
SpaceInformer2Reconciler reconciles external object from space.
func (*SpaceInformer2Reconciler) SetupWithManager ¶
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 ¶
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