Documentation
¶
Index ¶
- func ControllerName(name string) string
- func IsReady(_ context.Context, cd resource.Composed, t v1.ComposedTemplate) (bool, error)
- type APIConfigurator
- type APIConnectionDetailsFetcher
- type APIDefaultCompositionSelector
- type APIDryRunRenderer
- type APIFilteredSecretPublisher
- type APILabelSelectorResolver
- type APINamingConfigurator
- type CompositionSelector
- type CompositionSelectorChain
- type CompositionSelectorFn
- type Configurator
- type ConfiguratorChain
- type ConfiguratorFn
- type ConnectionDetailsFetcher
- type ConnectionDetailsFetcherFn
- type ConnectionPublisher
- type ConnectionPublisherFn
- type ConnectionSecretFilterer
- type EnforcedCompositionSelector
- type Observation
- type ReadinessChecker
- type ReadinessCheckerFn
- type Reconciler
- type ReconcilerOption
- func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption
- func WithCompositionSelector(p CompositionSelector) ReconcilerOption
- func WithConfigurator(c Configurator) ReconcilerOption
- func WithConnectionDetailsFetcher(f ConnectionDetailsFetcher) ReconcilerOption
- func WithConnectionPublisher(p ConnectionPublisher) ReconcilerOption
- func WithLogger(log logging.Logger) ReconcilerOption
- func WithReadinessChecker(c ReadinessChecker) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
- func WithRenderer(rd Renderer) ReconcilerOption
- type RenderFn
- type Renderer
- type RendererFn
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 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 *v1.Composition) error
Configure any required fields that were omitted from the composite resource by copying them from its composition.
type APIConnectionDetailsFetcher ¶
type APIConnectionDetailsFetcher struct {
// contains filtered or unexported fields
}
An APIConnectionDetailsFetcher may use the API server to read connection details from a Secret.
func NewAPIConnectionDetailsFetcher ¶
func NewAPIConnectionDetailsFetcher(c client.Client) *APIConnectionDetailsFetcher
NewAPIConnectionDetailsFetcher returns a ConnectionDetailsFetcher that may use the API server to read connection details from a Secret.
func (*APIConnectionDetailsFetcher) FetchConnectionDetails ¶
func (cdf *APIConnectionDetailsFetcher) FetchConnectionDetails(ctx context.Context, cd resource.Composed, t v1.ComposedTemplate) (managed.ConnectionDetails, error)
FetchConnectionDetails of the supplied composed resource, if any.
type APIDefaultCompositionSelector ¶
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 ¶
func NewAPIDefaultCompositionSelector(c client.Client, ref corev1.ObjectReference, r event.Recorder) *APIDefaultCompositionSelector
NewAPIDefaultCompositionSelector returns a APIDefaultCompositionSelector.
func (*APIDefaultCompositionSelector) SelectComposition ¶
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 APIDryRunRenderer ¶
type APIDryRunRenderer struct {
// contains filtered or unexported fields
}
An APIDryRunRenderer renders composed resources. It may perform a dry-run create against an API server in order to name and validate the rendered resource.
func NewAPIDryRunRenderer ¶
func NewAPIDryRunRenderer(c client.Client) *APIDryRunRenderer
NewAPIDryRunRenderer returns a Renderer of composed resources that may perform a dry-run create against an API server in order to name and validate it.
func (*APIDryRunRenderer) Render ¶
func (r *APIDryRunRenderer) Render(ctx context.Context, cp resource.Composite, cd resource.Composed, t v1.ComposedTemplate) error
Render the supplied composed resource using the supplied composite resource and template. The rendered resource may be submitted to an API server via a dry run create in order to name and validate it.
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) (bool, 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 ¶
type APILabelSelectorResolver struct {
// contains filtered or unexported fields
}
APILabelSelectorResolver is used to resolve the composition selector on the instance to composition reference.
func NewAPILabelSelectorResolver ¶
func NewAPILabelSelectorResolver(c client.Client) *APILabelSelectorResolver
NewAPILabelSelectorResolver returns a SelectorResolver for composite resource.
func (*APILabelSelectorResolver) SelectComposition ¶
func (r *APILabelSelectorResolver) SelectComposition(ctx context.Context, cp resource.Composite) error
SelectComposition resolves selector to a reference if it doesn't exist.
type APINamingConfigurator ¶
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 ¶
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 ¶
func (c *APINamingConfigurator) Configure(ctx context.Context, cp resource.Composite, _ *v1.Composition) error
Configure the supplied composite resource's root name prefix.
type CompositionSelector ¶
type CompositionSelector interface {
SelectComposition(ctx context.Context, cr resource.Composite) error
}
A CompositionSelector selects a composition reference.
type CompositionSelectorChain ¶
type CompositionSelectorChain struct {
// contains filtered or unexported fields
}
CompositionSelectorChain calls the given list of CompositionSelectors in order.
func NewCompositionSelectorChain ¶
func NewCompositionSelectorChain(list ...CompositionSelector) *CompositionSelectorChain
NewCompositionSelectorChain returns a new CompositionSelectorChain.
func (*CompositionSelectorChain) SelectComposition ¶
func (r *CompositionSelectorChain) SelectComposition(ctx context.Context, cp resource.Composite) error
SelectComposition calls all SelectComposition functions of CompositionSelectors in the list.
type CompositionSelectorFn ¶
A CompositionSelectorFn selects a composition reference.
func (CompositionSelectorFn) SelectComposition ¶
SelectComposition for the supplied composite resource.
type Configurator ¶
type Configurator interface {
Configure(ctx context.Context, cr resource.Composite, cp *v1.Composition) error
}
A Configurator configures a composite resource using its composition.
type ConfiguratorChain ¶
type ConfiguratorChain struct {
// contains filtered or unexported fields
}
ConfiguratorChain executes the Configurators in given order.
func NewConfiguratorChain ¶
func NewConfiguratorChain(l ...Configurator) *ConfiguratorChain
NewConfiguratorChain returns a new *ConfiguratorChain.
func (*ConfiguratorChain) Configure ¶
func (cc *ConfiguratorChain) Configure(ctx context.Context, cp resource.Composite, comp *v1.Composition) error
Configure calls Configure function of every Configurator in the list.
type ConfiguratorFn ¶
A ConfiguratorFn configures a composite resource using its composition.
func (ConfiguratorFn) Configure ¶
func (fn ConfiguratorFn) Configure(ctx context.Context, cr resource.Composite, cp *v1.Composition) error
Configure the supplied composite resource using its composition.
type ConnectionDetailsFetcher ¶
type ConnectionDetailsFetcher interface {
FetchConnectionDetails(ctx context.Context, cd resource.Composed, t v1.ComposedTemplate) (managed.ConnectionDetails, error)
}
ConnectionDetailsFetcher fetches the connection details of the Composed resource.
type ConnectionDetailsFetcherFn ¶
type ConnectionDetailsFetcherFn func(ctx context.Context, cd resource.Composed, t v1.ComposedTemplate) (managed.ConnectionDetails, error)
A ConnectionDetailsFetcherFn fetches the connection details of the supplied composed resource, if any.
func (ConnectionDetailsFetcherFn) FetchConnectionDetails ¶
func (f ConnectionDetailsFetcherFn) FetchConnectionDetails(ctx context.Context, cd resource.Composed, t v1.ComposedTemplate) (managed.ConnectionDetails, error)
FetchConnectionDetails calls the FetchConnectionDetailsFn.
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.
// Returns 'published' if the publish was not a no-op.
PublishConnection(ctx context.Context, o resource.ConnectionSecretOwner, c managed.ConnectionDetails) (published bool, err error)
}
A ConnectionPublisher publishes the supplied ConnectionDetails for the supplied resource. Publishers must handle the case in which the supplied ConnectionDetails are empty.
type ConnectionPublisherFn ¶
type ConnectionPublisherFn func(ctx context.Context, o resource.ConnectionSecretOwner, c managed.ConnectionDetails) (published bool, err error)
A ConnectionPublisherFn publishes the supplied ConnectionDetails for the supplied resource.
func (ConnectionPublisherFn) PublishConnection ¶
func (fn ConnectionPublisherFn) PublishConnection(ctx context.Context, o resource.ConnectionSecretOwner, c managed.ConnectionDetails) (published bool, err error)
PublishConnection details for the supplied resource.
type ConnectionSecretFilterer ¶
type ConnectionSecretFilterer interface {
GetConnectionSecretKeys() []string
}
ConnectionSecretFilterer returns a set of allowed keys.
type EnforcedCompositionSelector ¶
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 ¶
func NewEnforcedCompositionSelector(def v1.CompositeResourceDefinition, r event.Recorder) *EnforcedCompositionSelector
NewEnforcedCompositionSelector returns a EnforcedCompositionSelector.
func (*EnforcedCompositionSelector) SelectComposition ¶
func (s *EnforcedCompositionSelector) SelectComposition(_ context.Context, cp resource.Composite) error
SelectComposition selects the enforced composition if it's given in definition.
type Observation ¶
type Observation struct {
Ref corev1.ObjectReference
ConnectionDetails managed.ConnectionDetails
Ready bool
}
Observation is the result of composed reconciliation.
type ReadinessChecker ¶
type ReadinessChecker interface {
IsReady(ctx context.Context, cd resource.Composed, t v1.ComposedTemplate) (ready bool, err error)
}
A ReadinessChecker checks whether a composed resource is ready or not.
type ReadinessCheckerFn ¶
type ReadinessCheckerFn func(ctx context.Context, cd resource.Composed, t v1.ComposedTemplate) (ready bool, err error)
A ReadinessCheckerFn checks whether a composed resource is ready or not.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
A Reconciler reconciles composite resources.
func NewReconciler ¶
func NewReconciler(mgr manager.Manager, of resource.CompositeKind, opts ...ReconcilerOption) *Reconciler
NewReconciler returns a new Reconciler of composite resources.
type ReconcilerOption ¶
type ReconcilerOption func(*Reconciler)
ReconcilerOption is used to configure the Reconciler.
func WithClientApplicator ¶
func WithClientApplicator(ca resource.ClientApplicator) ReconcilerOption
WithClientApplicator specifies how the Reconciler should interact with the Kubernetes API.
func WithCompositionSelector ¶
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 WithConnectionDetailsFetcher ¶
func WithConnectionDetailsFetcher(f ConnectionDetailsFetcher) ReconcilerOption
WithConnectionDetailsFetcher specifies how the Reconciler should fetch the connection details of composed resources.
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 WithReadinessChecker ¶
func WithReadinessChecker(c ReadinessChecker) ReconcilerOption
WithReadinessChecker specifies how the Reconciler should fetch the connection details of composed resources.
func WithRecorder ¶
func WithRecorder(er event.Recorder) ReconcilerOption
WithRecorder specifies how the Reconciler should record Kubernetes events.
func WithRenderer ¶
func WithRenderer(rd Renderer) ReconcilerOption
WithRenderer specifies how the Reconciler should render composed resources.
type Renderer ¶
type Renderer interface {
Render(ctx context.Context, cp resource.Composite, cd resource.Composed, t v1.ComposedTemplate) error
}
A Renderer is used to render a composed resource.