manager

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package manager implements the generic logic to manage the resource reflection between the local and the remote cluster, for a set of resources and namespaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FallbackReflector added in v0.3.2

type FallbackReflector interface {
	// Handle is responsible for reconciling the given "orphan" object.
	Handle(ctx context.Context, key types.NamespacedName) error
	// Keys returns a set of keys to be enqueued for fallback processing for the given namespace pair.
	Keys(local, remote string) []types.NamespacedName
	// Ready returns whether the FallbackReflector is completely initialized.
	Ready() bool
	// List returns the list of objects to be reflected.
	List() ([]interface{}, error)
}

FallbackReflector implements fallback reflection for "orphan" local objects not managed by namespaced reflectors.

type Manager

type Manager interface {
	// With registers the given reflector to the manager.
	With(reflector Reflector) Manager
	// WithNamespaceHandler add the given NamespaceHandler to the manager.
	WithNamespaceHandler(handler NamespaceHandler) Manager
	// Start starts the reflection manager. It panics if executed twice.
	Start(ctx context.Context)
	// Resync triggers a resync of the reflectors.
	Resync() error

	NamespaceStartStopper
}

Manager manages the reflection of objects between the local and the remote cluster.

func New

func New(local, remote kubernetes.Interface, localLiqo, remoteLiqo liqoclient.Interface, resync time.Duration,
	eb record.EventBroadcaster, forgingOpts *forge.ForgingOpts) Manager

New returns a new manager to start the reflection towards a remote cluster.

type NamespaceHandler added in v0.3.2

type NamespaceHandler interface {
	// Start starts the NamespaceHandler.
	Start(context.Context, NamespaceStartStopper)
}

NamespaceHandler is responsible to call StartNamespace and StopNamespace for a Namespace that has been marked for resources reflection.

type NamespaceStartStopper added in v0.3.2

type NamespaceStartStopper interface {
	// StartNamespace starts the reflection for a given namespace.
	StartNamespace(local, remote string)
	// StopNamespace stops the reflection for a given namespace.
	StopNamespace(local, remote string)
}

NamespaceStartStopper manages the reflection at the namespace level.

type NamespacedReflector

type NamespacedReflector interface {
	// Handle is responsible for reconciling the given object and ensuring it is correctly reflected.
	Handle(ctx context.Context, name string) error
	// Ready returns whether the NamespacedReflector is completely initialized.
	Ready() bool
	// List returns the list of objects to be reflected.
	List() ([]interface{}, error)
}

NamespacedReflector implements the reflection between a local and a remote namespace.

type Reflector

type Reflector interface {
	// String returns the name of the reflector.
	String() string
	// Start starts the reflector.
	Start(ctx context.Context, opts *options.ReflectorOpts)
	// StartNamespace starts the reflection for the given namespace.
	StartNamespace(opts *options.NamespacedOpts)
	// StopNamespace stops the reflection for a given namespace.
	StopNamespace(local, remote string)
	// Resync triggers a resync of the reflector.
	Resync() error
}

Reflector implements the reflection between the local and the remote cluster.

Jump to

Keyboard shortcuts

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