Documentation ¶
Index ¶
- func ControllerName(name string) string
- type APIConfigurator
- type APIDefaultCompositionSelector
- type APIFilteredSecretPublisher
- type APILabelSelectorResolver
- type APINamingConfigurator
- type Composer
- type CompositionSelector
- type CompositionSelectorChain
- type Configurator
- type ConfiguratorChain
- type ConnectionPublisher
- type ConnectionSecretFilterer
- type EnforcedCompositionSelector
- type Reconciler
- type ReconcilerOption
- func WithComposer(rc Composer) ReconcilerOption
- func WithCompositionSelector(p CompositionSelector) ReconcilerOption
- func WithConfigurator(c Configurator) ReconcilerOption
- func WithConnectionPublisher(p ConnectionPublisher) ReconcilerOption
- func WithLogger(log logging.Logger) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
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 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, cp resource.Composite, comp *v1alpha1.Composition) error
Configure the supplied composite resource using its composition.
type APIDefaultCompositionSelector ¶ added in v0.12.0
type APIDefaultCompositionSelector struct {
// contains filtered or unexported fields
}
APIDefaultCompositionSelector selects the default composition referenced in the definition of the resource if neither a reference nor selector is given in composite resource.
func NewAPIDefaultCompositionSelector ¶ added in v0.12.0
func NewAPIDefaultCompositionSelector(c client.Client, ref corev1.ObjectReference, r event.Recorder) *APIDefaultCompositionSelector
NewAPIDefaultCompositionSelector returns a APIDefaultCompositionSelector.
func (*APIDefaultCompositionSelector) SelectComposition ¶ added in v0.12.0
func (s *APIDefaultCompositionSelector) SelectComposition(ctx context.Context, cp resource.Composite) error
SelectComposition selects the default compositionif neither a reference nor selector is given in composite resource.
type APIFilteredSecretPublisher ¶
type APIFilteredSecretPublisher struct {
// contains filtered or unexported fields
}
APIFilteredSecretPublisher publishes ConnectionDetails content after filtering it through a set of permitted keys.
func NewAPIFilteredSecretPublisher ¶
func NewAPIFilteredSecretPublisher(c client.Client, filter []string) *APIFilteredSecretPublisher
NewAPIFilteredSecretPublisher returns a ConnectionPublisher that only publishes connection secret keys that are included in the supplied filter.
func (*APIFilteredSecretPublisher) PublishConnection ¶
func (a *APIFilteredSecretPublisher) PublishConnection(ctx context.Context, o resource.ConnectionSecretOwner, c managed.ConnectionDetails) error
PublishConnection publishes the supplied ConnectionDetails to the Secret referenced in the resource.
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 APILabelSelectorResolver ¶ added in v0.12.0
type APILabelSelectorResolver struct {
// contains filtered or unexported fields
}
APILabelSelectorResolver is used to resolve the composition selector on the instance to composition reference.
func NewAPILabelSelectorResolver ¶ added in v0.12.0
func NewAPILabelSelectorResolver(c client.Client) *APILabelSelectorResolver
NewAPILabelSelectorResolver returns a SelectorResolver for composite resource.
func (*APILabelSelectorResolver) SelectComposition ¶ added in v0.12.0
func (r *APILabelSelectorResolver) SelectComposition(ctx context.Context, cp resource.Composite) error
SelectComposition resolves selector to a reference if it doesn't exist.
type APINamingConfigurator ¶ added in v0.12.0
type APINamingConfigurator struct {
// contains filtered or unexported fields
}
An APINamingConfigurator sets the root name prefix to its own name if it is not already set.
func NewAPINamingConfigurator ¶ added in v0.12.0
func NewAPINamingConfigurator(c client.Client) *APINamingConfigurator
NewAPINamingConfigurator returns a Configurator that sets the root name prefixKu to its own name if it is not already set.
func (*APINamingConfigurator) Configure ¶ added in v0.12.0
func (c *APINamingConfigurator) Configure(ctx context.Context, cp resource.Composite, _ *v1alpha1.Composition) error
Configure the supplied composite resource's root name prefix.
type Composer ¶
type Composer interface {
Compose(ctx context.Context, cp resource.Composite, cd resource.Composed, t v1alpha1.ComposedTemplate) (composedctrl.Observation, error)
}
A Composer composes infrastructure resources.
type CompositionSelector ¶ added in v0.12.0
type CompositionSelector interface {
SelectComposition(ctx context.Context, cr resource.Composite) error
}
CompositionSelector selects a composition reference.
type CompositionSelectorChain ¶ added in v0.12.0
type CompositionSelectorChain struct {
// contains filtered or unexported fields
}
CompositionSelectorChain calls the given list of CompositionSelectors in order.
func NewCompositionSelectorChain ¶ added in v0.12.0
func NewCompositionSelectorChain(list ...CompositionSelector) *CompositionSelectorChain
NewCompositionSelectorChain returns a new CompositionSelectorChain.
func (*CompositionSelectorChain) SelectComposition ¶ added in v0.12.0
func (r *CompositionSelectorChain) SelectComposition(ctx context.Context, cp resource.Composite) error
SelectComposition calls all SelectComposition functions of CompositionSelectors in the list.
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 ConfiguratorChain ¶ added in v0.12.0
type ConfiguratorChain struct {
// contains filtered or unexported fields
}
ConfiguratorChain executes the Configurators in given order.
func NewConfiguratorChain ¶ added in v0.12.0
func NewConfiguratorChain(l ...Configurator) *ConfiguratorChain
NewConfiguratorChain returns a new *ConfiguratorChain.
func (*ConfiguratorChain) Configure ¶ added in v0.12.0
func (cc *ConfiguratorChain) Configure(ctx context.Context, cp resource.Composite, comp *v1alpha1.Composition) error
Configure calls Configure function of every Configurator in the list.
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.
type ConnectionSecretFilterer ¶
type ConnectionSecretFilterer interface {
GetConnectionSecretKeys() []string
}
ConnectionSecretFilterer returns a set of allowed keys.
type EnforcedCompositionSelector ¶ added in v0.12.0
type EnforcedCompositionSelector struct {
// contains filtered or unexported fields
}
EnforcedCompositionSelector , if it's given, selects the enforced composition on the definition for all composite instances.
func NewEnforcedCompositionSelector ¶ added in v0.12.0
func NewEnforcedCompositionSelector(def v1alpha1.InfrastructureDefinition, r event.Recorder) *EnforcedCompositionSelector
NewEnforcedCompositionSelector returns a EnforcedCompositionSelector.
func (*EnforcedCompositionSelector) SelectComposition ¶ added in v0.12.0
func (s *EnforcedCompositionSelector) SelectComposition(_ context.Context, cp resource.Composite) error
SelectComposition selects the enforced composition if it's given in definition.
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 WithCompositionSelector ¶ added in v0.12.0
func WithCompositionSelector(p CompositionSelector) ReconcilerOption
WithCompositionSelector specifies how the composition to be used should be selected.
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.