claim

package
v0.0.0-...-c54dba7 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configurator

type Configurator interface {
	Configure(ctx context.Context, local, remote *claim.Unstructured) error
}

Configurator configures the supplied remote instance.

type ConnectionSecretPropagator

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

ConnectionSecretPropagator fetches the connection secret from the remote cluster and applies it in the local cluster.

func NewConnectionSecretPropagator

func NewConnectionSecretPropagator(local, remote runtimeresource.ClientApplicator) *ConnectionSecretPropagator

NewConnectionSecretPropagator returns a new *ConnectionSecretPropagator.

func (*ConnectionSecretPropagator) Propagate

func (csp *ConnectionSecretPropagator) Propagate(ctx context.Context, local, remote *claim.Unstructured) error

Propagate propagates the connection secret from remote cluster to local cluster.

type DefaultConfigurator

type DefaultConfigurator struct{}

DefaultConfigurator configures ObjectMeta and Spec of the remote instance with the information from the local instance.

func NewDefaultConfigurator

func NewDefaultConfigurator() *DefaultConfigurator

NewDefaultConfigurator returns a new DefaultConfigurator.

func (*DefaultConfigurator) Configure

func (sp *DefaultConfigurator) Configure(_ context.Context, local, remote *claim.Unstructured) error

Configure copies spec and user-defined metadata from local object to the remote one.

type LateInitializer

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

LateInitializer fills up the empty fields of "desired" object with the values in "observed" object.

func NewLateInitializer

func NewLateInitializer(kube client.Client) *LateInitializer

NewLateInitializer returns a new LateInitializer.

func (*LateInitializer) Propagate

func (li *LateInitializer) Propagate(ctx context.Context, local, remote *claim.Unstructured) error

Propagate copies the values from observed to desired if that field is empty in desired object.

type PropagateFn

type PropagateFn func(ctx context.Context, local, remote *claim.Unstructured) error

PropagateFn is used to construct a Propagator with a bare function.

func (PropagateFn) Propagate

func (p PropagateFn) Propagate(ctx context.Context, local, remote *claim.Unstructured) error

Propagate calls the supplied function.

type Propagator

type Propagator interface {
	Propagate(ctx context.Context, local, remote *claim.Unstructured) error
}

Propagator is used to propagate values from remote to the local object.

type PropagatorChain

type PropagatorChain []Propagator

PropagatorChain calls Propagate method of all of its Propagators in order.

func NewPropagatorChain

func NewPropagatorChain(p ...Propagator) PropagatorChain

NewPropagatorChain returns a new PropagatorChain.

func (PropagatorChain) Propagate

func (pp PropagatorChain) Propagate(ctx context.Context, local, remote *claim.Unstructured) error

Propagate calls all Propagate functions one by one.

type Reconciler

type Reconciler struct {
	Configurator
	Propagator
	// contains filtered or unexported fields
}

Reconciler syncs the given claim instance from local cluster to remote cluster and fetches its connection secret to local cluster if it's available.

func NewReconciler

func NewReconciler(mgr manager.Manager, remoteClient client.Client, gvk schema.GroupVersionKind, opts ...ReconcilerOption) *Reconciler

NewReconciler returns a new *Reconciler.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(req reconcile.Request) (reconcile.Result, error)

Reconcile watches the given type and does necessary sync operations.

type ReconcilerOption

type ReconcilerOption func(*Reconciler)

ReconcilerOption is used to configure *Reconciler.

func WithFinalizer

WithFinalizer specifies how the Reconciler should add and remove finalizers.

func WithLogger

func WithLogger(l logging.Logger) ReconcilerOption

WithLogger specifies how the Reconciler should log messages.

func WithPropagator

func WithPropagator(p Propagator) ReconcilerOption

WithPropagator specifies how the Reconciler should propagate values and objects between clusters.

func WithRecorder

func WithRecorder(rec event.Recorder) ReconcilerOption

WithRecorder specifies how the Reconciler should record events.

type StatusPropagator

type StatusPropagator struct{}

StatusPropagator propagates the status from the second object to the first one.

func NewStatusPropagator

func NewStatusPropagator() *StatusPropagator

NewStatusPropagator returns a new StatusPropagator.

func (*StatusPropagator) Propagate

func (sp *StatusPropagator) Propagate(ctx context.Context, local, remote *claim.Unstructured) error

Propagate copies the status of remote object into local object.

Jump to

Keyboard shortcuts

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