crdReplicator

package
v0.0.0-...-5a253b8 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LocalLabelSelector     = "liqo.io/replication"
	RemoteLabelSelector    = "liqo.io/originID"
	DestinationLabel       = "liqo.io/remoteID"
	ReplicationStatuslabel = "liqo.io/replicated"
)

Functions

This section is empty.

Types

type CRDReplicatorReconciler

type CRDReplicatorReconciler struct {
	Scheme *runtime.Scheme
	client.Client
	ClientSet *kubernetes.Clientset
	ClusterID string
	//for each remote cluster we save dynamic client connected to its API server
	RemoteDynClients map[string]dynamic.Interface
	//dynamic client pointing to the local API server
	LocalDynClient dynamic.Interface
	//a list of GVRs of resources to be replicated
	RegisteredResources []schema.GroupVersionResource
	//each time a resource is removed from the configuration it is saved in this list,
	//it stays here until the associated watcher, if running, is stopped
	UnregisteredResources []string
	//for each peering cluster we save all the running watchers monitoring the local resources:(clusterID, (registeredResource, chan))
	LocalWatchers map[string]map[string]chan bool
	//for each peering cluster we save all the running watchers monitoring the replicated resources:(clusterID, (registeredResource, chan))
	RemoteWatchers map[string]map[string]chan bool
}

func (*CRDReplicatorReconciler) AddedHandler

func (*CRDReplicatorReconciler) CreateResource

func (*CRDReplicatorReconciler) DeleteResource

func (*CRDReplicatorReconciler) DeletedHandler

func (*CRDReplicatorReconciler) GetConfig

func (*CRDReplicatorReconciler) GetRemovedResources

func (d *CRDReplicatorReconciler) GetRemovedResources(resources []schema.GroupVersionResource) []string

func (*CRDReplicatorReconciler) GetResource

func (d *CRDReplicatorReconciler) GetResource(client dynamic.Interface, gvr schema.GroupVersionResource, name, namespace, clusterID string) (*unstructured.Unstructured, bool, error)

func (*CRDReplicatorReconciler) LocalWatcher

func (d *CRDReplicatorReconciler) LocalWatcher(gvr schema.GroupVersionResource, stop chan bool, remoteClusterID string)

func (*CRDReplicatorReconciler) ModifiedHandler

func (*CRDReplicatorReconciler) Reconcile

func (d *CRDReplicatorReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

func (*CRDReplicatorReconciler) RemoteResourceModifiedHandler

func (d *CRDReplicatorReconciler) RemoteResourceModifiedHandler(obj *unstructured.Unstructured, gvr schema.GroupVersionResource, remoteClusterId string)

func (*CRDReplicatorReconciler) RemoteWatcher

func (d *CRDReplicatorReconciler) RemoteWatcher(dynClient dynamic.Interface, gvr schema.GroupVersionResource, stop chan bool, remoteClusterID string)

func (*CRDReplicatorReconciler) SetupWithManager

func (d *CRDReplicatorReconciler) SetupWithManager(mgr ctrl.Manager) error

func (*CRDReplicatorReconciler) StartWatchers

func (d *CRDReplicatorReconciler) StartWatchers()

func (*CRDReplicatorReconciler) StopWatchers

func (d *CRDReplicatorReconciler) StopWatchers()

Stops all the watchers for the resources that have been unregistered

func (*CRDReplicatorReconciler) UpdateConfig

func (*CRDReplicatorReconciler) UpdateLabels

func (d *CRDReplicatorReconciler) UpdateLabels(labels map[string]string) map[string]string

func (*CRDReplicatorReconciler) UpdateMetadata

updates the following field of metadata: labels

func (*CRDReplicatorReconciler) UpdateResource

func (*CRDReplicatorReconciler) UpdateSpec

func (d *CRDReplicatorReconciler) UpdateSpec(client dynamic.Interface, gvr schema.GroupVersionResource, obj *unstructured.Unstructured, clusterID string, spec map[string]interface{}) error

updates the spec field of a resource

func (*CRDReplicatorReconciler) UpdateStatus

func (d *CRDReplicatorReconciler) UpdateStatus(client dynamic.Interface, gvr schema.GroupVersionResource, obj *unstructured.Unstructured, clusterID string, status map[string]interface{}) error

updates the status field of a resource

func (*CRDReplicatorReconciler) WatchConfiguration

func (d *CRDReplicatorReconciler) WatchConfiguration(config *rest.Config, gv *schema.GroupVersion) error

Jump to

Keyboard shortcuts

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