reflection

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package reflection implements the reflection logic of custom resources between a local cluster to a remote one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalResourcesLabelSelector

func LocalResourcesLabelSelector() metav1.LabelSelector

LocalResourcesLabelSelector is an helper function which returns a label selector to list all the local resources to be replicated.

func ReplicatedResourcesLabelSelector

func ReplicatedResourcesLabelSelector() metav1.LabelSelector

ReplicatedResourcesLabelSelector is an helper function which returns a label selector to list all the replicated resources.

Types

type Manager

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

Manager represents an object creating reflectors towards remote clusters.

func NewManager

func NewManager(client dynamic.Interface, clusterID string, workersPerCluster uint, resync time.Duration) *Manager

NewManager returns a new manager to start the reflection towards remote clusters.

func (*Manager) NewForRemote

func (m *Manager) NewForRemote(client dynamic.Interface, clusterID, localNamespace, remoteNamespace string) *Reflector

NewForRemote returns a new reflector for a given remote cluster.

func (*Manager) Start

func (m *Manager) Start(ctx context.Context, registeredResources []resources.Resource)

Start starts the manager registering the given resources.

type Reflector

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

Reflector represents an object managing the reflection of resources towards a given remote cluster.

func (*Reflector) ResourceStarted

func (r *Reflector) ResourceStarted(resource *resources.Resource) bool

ResourceStarted returns whether the reflection for the given resource has been started.

func (*Reflector) Start

func (r *Reflector) Start(ctx context.Context)

Start starts the reflection towards the remote cluster.

func (*Reflector) StartForResource

func (r *Reflector) StartForResource(ctx context.Context, resource *resources.Resource)

StartForResource starts the reflection of the given resource. It panics if executed for a resource with the reflection already started.

func (*Reflector) Stop

func (r *Reflector) Stop() error

Stop stops the reflection towards the remote cluster, and removes the replicated resources.

func (*Reflector) StopForResource

func (r *Reflector) StopForResource(resource *resources.Resource) error

StopForResource stops the reflection of the given resource, and removes the replicated objects.

Jump to

Keyboard shortcuts

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