target

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 21 Imported by: 3

Documentation

Overview

Package target is the package that is responsible to maintain the kcc-target logic

handler.go: store kcc-target mapping info (mata) in-memory, common use cases include - maintain accessor lifecycle for a given kcc-target CRD - find kcc-target CR for a given kcc CR (considering history data rather than current CR) - find kcc CR for a given kcc-target CR (considering history data rather than current CR) ...

accessor.go: construct a handler for each given kcc-target (mapping with 1:1), common use cases include - maintain the informer lifecycle for each kcc-target CRD - handle events for each kcc-target CR (using registered handler function) ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyKatalystCustomConfigTargetAccessor

type DummyKatalystCustomConfigTargetAccessor struct{}

func (DummyKatalystCustomConfigTargetAccessor) Enqueue

func (DummyKatalystCustomConfigTargetAccessor) Get

func (DummyKatalystCustomConfigTargetAccessor) List

func (DummyKatalystCustomConfigTargetAccessor) Start

func (DummyKatalystCustomConfigTargetAccessor) Stop

type KatalystCustomConfigTargetAccessor

type KatalystCustomConfigTargetAccessor interface {
	// Start to reconcile obj of kcc target type
	Start()

	// Stop reconcile obj of kcc target type
	Stop()

	// Enqueue obj of kcc target type to the work queue
	Enqueue(name string, obj *unstructured.Unstructured)

	// List all obj (with DeepCopy) of kcc target type according selector
	List(selector labels.Selector) ([]*unstructured.Unstructured, error)

	// Get obj (with DeepCopy) of kcc target type by namespace and name
	Get(namespace, name string) (*unstructured.Unstructured, error)
}

KatalystCustomConfigTargetAccessor is to handle creation/update/delete event of target unstructured obj, and it can trigger obj re-sync by calling Enqueue function

type KatalystCustomConfigTargetHandler

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

func NewKatalystCustomConfigTargetHandler

func NewKatalystCustomConfigTargetHandler(ctx context.Context, client *kcclient.GenericClientSet, kccConfig *controller.KCCConfig,
	katalystCustomConfigInformer configinformers.KatalystCustomConfigInformer) *KatalystCustomConfigTargetHandler

func (*KatalystCustomConfigTargetHandler) GetKCCKeyListByGVR

GetKCCKeyListByGVR get kcc keyList by gvr.

func (*KatalystCustomConfigTargetHandler) GetTargetAccessorByGVR

func (*KatalystCustomConfigTargetHandler) RangeGVRTargetAccessor

RangeGVRTargetAccessor is used to walk through all accessors and perform the given function

func (*KatalystCustomConfigTargetHandler) RegisterTargetHandler

func (k *KatalystCustomConfigTargetHandler) RegisterTargetHandler(name string, handlerFunc KatalystCustomConfigTargetHandlerFunc)

RegisterTargetHandler is used to register handler functions for the given gvr

func (*KatalystCustomConfigTargetHandler) Run

type KatalystCustomConfigTargetHandlerFunc

type KatalystCustomConfigTargetHandlerFunc func(gvr metav1.GroupVersionResource, target *unstructured.Unstructured) error

KatalystCustomConfigTargetHandlerFunc func to process the obj in the work queue

type RealKatalystCustomConfigTargetAccessor

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

func NewRealKatalystCustomConfigTargetAccessor

func NewRealKatalystCustomConfigTargetAccessor(
	gvr metav1.GroupVersionResource,
	client dynamic.Interface,
	handlerInfos map[string]KatalystCustomConfigTargetHandlerFunc,
) (*RealKatalystCustomConfigTargetAccessor, error)

NewRealKatalystCustomConfigTargetAccessor returns a new KatalystCustomConfigTargetAccessor which is used to handle creation/update/delete event of target unstructured obj, and it can trigger obj re-sync by calling Enqueue function of the returned accessor.

func (*RealKatalystCustomConfigTargetAccessor) Enqueue

Enqueue will add the obj to the work queue of the target handler, if name is empty, it will add the obj to all the work queue of the target handler

func (*RealKatalystCustomConfigTargetAccessor) Get

func (*RealKatalystCustomConfigTargetAccessor) List

func (*RealKatalystCustomConfigTargetAccessor) Start

func (*RealKatalystCustomConfigTargetAccessor) Stop

Jump to

Keyboard shortcuts

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