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 ¶
- type DummyKatalystCustomConfigTargetAccessor
- func (d DummyKatalystCustomConfigTargetAccessor) Enqueue(_ *unstructured.Unstructured)
- func (d DummyKatalystCustomConfigTargetAccessor) Get(_, _ string) (*unstructured.Unstructured, error)
- func (d DummyKatalystCustomConfigTargetAccessor) List(_ labels.Selector) ([]*unstructured.Unstructured, error)
- func (d DummyKatalystCustomConfigTargetAccessor) Start()
- func (d DummyKatalystCustomConfigTargetAccessor) Stop()
- type KatalystCustomConfigTargetAccessor
- type KatalystCustomConfigTargetHandler
- func (k *KatalystCustomConfigTargetHandler) GetKCCKeyListByGVR(gvr metav1.GroupVersionResource) []string
- func (k *KatalystCustomConfigTargetHandler) GetTargetAccessorByGVR(gvr metav1.GroupVersionResource) (KatalystCustomConfigTargetAccessor, bool)
- func (k *KatalystCustomConfigTargetHandler) RangeGVRTargetAccessor(...)
- func (k *KatalystCustomConfigTargetHandler) RegisterTargetHandler(name string, handlerFunc KatalystCustomConfigTargetHandlerFunc)
- func (k *KatalystCustomConfigTargetHandler) Run()
- type KatalystCustomConfigTargetHandlerFunc
- type RealKatalystCustomConfigTargetAccessor
- func (k *RealKatalystCustomConfigTargetAccessor) Enqueue(name string, obj *unstructured.Unstructured)
- func (k *RealKatalystCustomConfigTargetAccessor) Get(namespace, name string) (*unstructured.Unstructured, error)
- func (k *RealKatalystCustomConfigTargetAccessor) List(selector labels.Selector) ([]*unstructured.Unstructured, error)
- func (k *RealKatalystCustomConfigTargetAccessor) Start()
- func (k *RealKatalystCustomConfigTargetAccessor) Stop()
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 (d DummyKatalystCustomConfigTargetAccessor) Enqueue(_ *unstructured.Unstructured)
func (DummyKatalystCustomConfigTargetAccessor) Get ¶
func (d DummyKatalystCustomConfigTargetAccessor) Get(_, _ string) (*unstructured.Unstructured, error)
func (DummyKatalystCustomConfigTargetAccessor) List ¶
func (d DummyKatalystCustomConfigTargetAccessor) List(_ labels.Selector) ([]*unstructured.Unstructured, error)
func (DummyKatalystCustomConfigTargetAccessor) Start ¶
func (d DummyKatalystCustomConfigTargetAccessor) Start()
func (DummyKatalystCustomConfigTargetAccessor) Stop ¶
func (d 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 ¶
func (k *KatalystCustomConfigTargetHandler) GetKCCKeyListByGVR(gvr metav1.GroupVersionResource) []string
GetKCCKeyListByGVR get kcc keyList by gvr.
func (*KatalystCustomConfigTargetHandler) GetTargetAccessorByGVR ¶
func (k *KatalystCustomConfigTargetHandler) GetTargetAccessorByGVR(gvr metav1.GroupVersionResource) (KatalystCustomConfigTargetAccessor, bool)
func (*KatalystCustomConfigTargetHandler) RangeGVRTargetAccessor ¶
func (k *KatalystCustomConfigTargetHandler) RangeGVRTargetAccessor(f func(gvr metav1.GroupVersionResource, accessor KatalystCustomConfigTargetAccessor) bool)
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 ¶
func (k *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 ¶
func (k *RealKatalystCustomConfigTargetAccessor) Enqueue(name string, obj *unstructured.Unstructured)
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 (k *RealKatalystCustomConfigTargetAccessor) Get(namespace, name string) (*unstructured.Unstructured, error)
func (*RealKatalystCustomConfigTargetAccessor) List ¶
func (k *RealKatalystCustomConfigTargetAccessor) List(selector labels.Selector) ([]*unstructured.Unstructured, error)
func (*RealKatalystCustomConfigTargetAccessor) Start ¶
func (k *RealKatalystCustomConfigTargetAccessor) Start()
func (*RealKatalystCustomConfigTargetAccessor) Stop ¶
func (k *RealKatalystCustomConfigTargetAccessor) Stop()