manager

package
v0.3.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 12 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 Manager

type Manager interface {
	// With registers the given reflector to the manager.
	With(reflector Reflector) Manager
	// Start starts the reflection manager. It panics if executed twice.
	Start(ctx context.Context)

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

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

func New

func New(local, remote kubernetes.Interface, resync time.Duration) Manager

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

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
	// SetReady marks the NamespacedReflector as completely initialized.
	SetReady()
}

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

type Reflector

type Reflector interface {
	// Start starts the reflector.
	Start(ctx context.Context)
	// StartNamespace starts the reflection for the given namespace.
	StartNamespace(opts *options.ReflectorOpts)
	// StopNamespace stops the reflection for a given namespace.
	StopNamespace(localNamespace, remoteNamespace string)
	// SetNamespaceReady marks the given namespace as ready for resource reflection.
	SetNamespaceReady(namespace string)
}

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