incoming

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package incoming contains the logic to configure the reflection of target objects from a foreign cluster to the home cluster

Index

Constants

This section is empty.

Variables

View Source
var ReflectorBuilder = map[apimgmt.ApiType]func(reflector ri.APIReflector, opts map[options.OptionKey]options.Option) ri.IncomingAPIReflector{
	apimgmt.Pods:        podsReflectorBuilder,
	apimgmt.ReplicaSets: replicaSetsReflectorBuilder,
}

Functions

func GetHomePodFunc added in v0.3.0

func GetHomePodFunc(reflector ri.APIReflector, foreignPod *corev1.Pod) (*corev1.Pod, error)

GetHomePodFunc retrieves the shadow home pod given the foreign pod.

Types

type HomePodGetter added in v0.3.0

type HomePodGetter func(reflector ri.APIReflector, foreignPod *corev1.Pod) (*corev1.Pod, error)

HomePodGetter function to retrieve the shadow home pod given the foreign pod.

type PodsIncomingReflector

type PodsIncomingReflector struct {
	ri.APIReflector
	HomePodGetter HomePodGetter
}

PodsIncomingReflector is the incoming reflector in charge of detecting status change in foreign pods and pushing the updated object to the vk internals.

func (*PodsIncomingReflector) CleanupNamespace

func (r *PodsIncomingReflector) CleanupNamespace(namespace string)

CleanupNamespace is in charge of cleaning a local namespace from all the reflected objects. All the home objects in the home namespace are fetched and deleted locally. Their deletion will implies the delete of the remote replicasets.

func (*PodsIncomingReflector) GetHomePod added in v0.3.0

func (r *PodsIncomingReflector) GetHomePod(foreignPod *corev1.Pod) (*corev1.Pod, error)

GetHomePod retrieves the shadow home pod given the foreign pod.

func (*PodsIncomingReflector) HandleEvent

func (r *PodsIncomingReflector) HandleEvent(e interface{})

HandleEvent is the final function call in charge of pushing the foreignPod to the vk internals.

func (*PodsIncomingReflector) PreAdd

func (r *PodsIncomingReflector) PreAdd(obj interface{}) (interface{}, watch.EventType)

PreAdd is the pre-routine called in case of pod creation in the foreign cluster. It returns the home object with its status updated.

func (*PodsIncomingReflector) PreDelete

func (r *PodsIncomingReflector) PreDelete(obj interface{}) (interface{}, watch.EventType)

PreDelete removes the received object from the blacklist for freeing the occupied space.

func (*PodsIncomingReflector) PreUpdate

func (r *PodsIncomingReflector) PreUpdate(newObj, _ interface{}) (interface{}, watch.EventType)

PreAdd is the pre-routine called in case of pod update in the foreign cluster. It returns the home object with its status updated.

func (*PodsIncomingReflector) SetSpecializedPreProcessingHandlers

func (r *PodsIncomingReflector) SetSpecializedPreProcessingHandlers()

SetSpecializedPreProcessingHandlers allows to set the pre-routine handlers for the PodsIncomingReflector.

type ReplicaSetsIncomingReflector

type ReplicaSetsIncomingReflector struct {
	ri.APIReflector
}

ReplicaSetsIncomingReflector is in charge of reflecting remote replicasets status change in the home cluster.

func (*ReplicaSetsIncomingReflector) CleanupNamespace

func (r *ReplicaSetsIncomingReflector) CleanupNamespace(namespace string)

CleanupNamespace does nothing because the delete of the remote replicasets is already triggered by pods incoming reflector with its CleanupNamespace implementation.

func (*ReplicaSetsIncomingReflector) HandleEvent

func (r *ReplicaSetsIncomingReflector) HandleEvent(obj interface{})

HandleEvent takes the replicaset event and performs an operation in the home cluster. The only event to be handled by this reflector is the deletion of a replicaset Once a delete event is received, the object embedded in the received struct is a pod to be deleted in the home cluster.

func (*ReplicaSetsIncomingReflector) SetSpecializedPreProcessingHandlers

func (r *ReplicaSetsIncomingReflector) SetSpecializedPreProcessingHandlers()

Jump to

Keyboard shortcuts

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