composite

package
v0.11.0-rc Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ControllerName

func ControllerName(name string) string

ControllerName returns the recommended name for controllers that use this package to reconcile a particular kind of composite infrastructure resource.

Types

type APIComposer

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

An APIComposer composes infrastructure resources in a Kubernetes API server.

func NewAPIComposer

func NewAPIComposer(c client.Client) *APIComposer

NewAPIComposer returns a new Composer that composes infrastructure resources in a Kubernetes API server.

func (*APIComposer) Compose

Compose the supplied Composed resource into the supplied Composite resource using the supplied CompositeTemplate.

type APIConfigurator

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

An APIConfigurator configures a composite resource using its composition.

func NewAPIConfigurator

func NewAPIConfigurator(c client.Client) *APIConfigurator

NewAPIConfigurator returns a Configurator that configures a composite resource using its composition.

func (*APIConfigurator) Configure

Configure the supplied composite resource using its composition.

type APIFilteredSecretPublisher

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

APIFilteredSecretPublisher publishes ConnectionDetails content after filtering it through a set of permitted keys.

func (*APIFilteredSecretPublisher) PublishConnection

PublishConnection publishes the supplied ConnectionDetails to a Secret in the same namespace as the supplied Managed resource. It is a no-op if the secret already exists with the supplied ConnectionDetails.

func (*APIFilteredSecretPublisher) UnpublishConnection

UnpublishConnection is no-op since PublishConnection only creates resources that will be garbage collected by Kubernetes when the managed resource is deleted.

type APISelectorResolver

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

APISelectorResolver is used to resolve the composition selector on the instance to composition reference.

func (*APISelectorResolver) ResolveSelector

func (r *APISelectorResolver) ResolveSelector(ctx context.Context, cr resource.Composite) error

ResolveSelector resolves selector to a reference if it doesn't exist.

type Composer

type Composer interface {
	Compose(ctx context.Context, cp resource.Composite, cd resource.Composed, t v1alpha1.ComposedTemplate) (Observation, error)
}

A Composer composes infrastructure resources.

type Configurator

type Configurator interface {
	Configure(ctx context.Context, cr resource.Composite, cp *v1alpha1.Composition) error
}

A Configurator configures a composite resource using its composition.

type ConnectionPublisher

type ConnectionPublisher interface {
	// PublishConnection details for the supplied resource. Publishing
	// must be additive; i.e. if details (a, b, c) are published, subsequently
	// publishing details (b, c, d) should update (b, c) but not remove a.
	PublishConnection(ctx context.Context, o resource.ConnectionSecretOwner, c managed.ConnectionDetails) error

	// UnpublishConnection details for the supplied resource.
	UnpublishConnection(ctx context.Context, o resource.ConnectionSecretOwner, c managed.ConnectionDetails) error
}

A ConnectionPublisher manages the supplied ConnectionDetails for the supplied resource. Publishers must handle the case in which the supplied ConnectionDetails are empty.

func NewAPIFilteredSecretPublisher

func NewAPIFilteredSecretPublisher(c client.Client, filter []string) ConnectionPublisher

NewAPIFilteredSecretPublisher returns a ConnectionPublisher that only publishes connection secret keys that are included in the supplied filter.

type ConnectionSecretFilterer

type ConnectionSecretFilterer interface {
	GetConnectionSecretKeys() []string
}

ConnectionSecretFilterer returns a set of allowed keys.

type Observation

type Observation struct {
	Ref               corev1.ObjectReference
	ConnectionDetails managed.ConnectionDetails
	Ready             bool
}

Observation is the result of composed reconciliation.

type Reconciler

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

A Reconciler reconciles composite infrastructure resources.

func NewReconciler

func NewReconciler(mgr manager.Manager, of resource.CompositeKind, opts ...ReconcilerOption) *Reconciler

NewReconciler returns a new Reconciler of composite infrastructure resources.

func (*Reconciler) Reconcile

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

Reconcile a composite infrastructure resource.

type ReconcilerOption

type ReconcilerOption func(*Reconciler)

ReconcilerOption is used to configure the Reconciler.

func WithComposer

func WithComposer(rc Composer) ReconcilerOption

WithComposer specifies how the Reconciler should compose resources.

func WithConfigurator

func WithConfigurator(c Configurator) ReconcilerOption

WithConfigurator specifies how the Reconciler should configure composite resources using their composition

func WithConnectionPublisher

func WithConnectionPublisher(p ConnectionPublisher) ReconcilerOption

WithConnectionPublisher specifies how the Reconciler should publish connection secrets.

func WithLogger

func WithLogger(log logging.Logger) ReconcilerOption

WithLogger specifies how the Reconciler should log messages.

func WithRecorder

func WithRecorder(er event.Recorder) ReconcilerOption

WithRecorder specifies how the Reconciler should record Kubernetes events.

func WithSelectorResolver

func WithSelectorResolver(p SelectorResolver) ReconcilerOption

WithSelectorResolver specifies how the Reconciler should publish connection secrets.

type SelectorResolver

type SelectorResolver interface {
	ResolveSelector(ctx context.Context, cr resource.Composite) error
}

SelectorResolver selects the composition reference with the information given as selector.

func NewAPISelectorResolver

func NewAPISelectorResolver(c client.Client) SelectorResolver

NewAPISelectorResolver returns a SelectorResolver for composite resource.

Jump to

Keyboard shortcuts

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