Documentation
¶
Index ¶
- func ControllerName(name string) string
- type APIComposer
- type APIConfigurator
- type APIFilteredSecretPublisher
- type APISelectorResolver
- type Composer
- type Configurator
- type ConnectionPublisher
- type ConnectionSecretFilterer
- type Observation
- type Reconciler
- type ReconcilerOption
- func WithComposer(rc Composer) ReconcilerOption
- func WithConfigurator(c Configurator) ReconcilerOption
- func WithConnectionPublisher(p ConnectionPublisher) ReconcilerOption
- func WithLogger(log logging.Logger) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
- func WithSelectorResolver(p SelectorResolver) ReconcilerOption
- type SelectorResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControllerName ¶
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 ¶
func (r *APIComposer) Compose(ctx context.Context, cp resource.Composite, cd resource.Composed, t v1alpha1.ComposedTemplate) (Observation, error)
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 ¶
func (c *APIConfigurator) Configure(ctx context.Context, cr resource.Composite, cp *v1alpha1.Composition) error
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 ¶
func (a *APIFilteredSecretPublisher) PublishConnection(ctx context.Context, o resource.ConnectionSecretOwner, c managed.ConnectionDetails) error
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 ¶
func (a *APIFilteredSecretPublisher) UnpublishConnection(_ context.Context, _ resource.ConnectionSecretOwner, _ managed.ConnectionDetails) error
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 ¶
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.
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.