Documentation ¶
Index ¶
- func Setup(mgr ctrl.Manager, l logging.Logger) error
- type ComponentRenderFn
- type ComponentRenderer
- type GarbageCollector
- type GarbageCollectorFn
- type Parameter
- type ParameterResolveFn
- type ParameterResolver
- type Reconciler
- type ReconcilerOption
- type ResourceRenderFn
- type ResourceRenderer
- type Workload
- type WorkloadApplicator
- type WorkloadApplyFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ComponentRenderFn ¶
type ComponentRenderFn func(ctx context.Context, ac *v1alpha2.ApplicationConfiguration) ([]Workload, error)
A ComponentRenderFn renders an ApplicationConfiguration's Components into workloads and traits.
func (ComponentRenderFn) Render ¶
func (fn ComponentRenderFn) Render(ctx context.Context, ac *v1alpha2.ApplicationConfiguration) ([]Workload, error)
Render an ApplicationConfiguration's Components into workloads and traits.
type ComponentRenderer ¶
type ComponentRenderer interface {
Render(ctx context.Context, ac *v1alpha2.ApplicationConfiguration) ([]Workload, error)
}
A ComponentRenderer renders an ApplicationConfiguration's Components into workloads and traits.
type GarbageCollector ¶
type GarbageCollector interface {
Eligible(namespace string, ws []v1alpha2.WorkloadStatus, w []Workload) []unstructured.Unstructured
}
A GarbageCollector returns resource eligible for garbage collection. A resource is considered eligible if a reference exists in the supplied slice of workload statuses, but not in the supplied slice of workloads.
type GarbageCollectorFn ¶
type GarbageCollectorFn func(namespace string, ws []v1alpha2.WorkloadStatus, w []Workload) []unstructured.Unstructured
A GarbageCollectorFn returns resource eligible for garbage collection.
func (GarbageCollectorFn) Eligible ¶
func (fn GarbageCollectorFn) Eligible(namespace string, ws []v1alpha2.WorkloadStatus, w []Workload) []unstructured.Unstructured
Eligible resources.
type Parameter ¶
type Parameter struct { // Name of this parameter. Name string // Value of this parameter. Value intstr.IntOrString // FieldPaths that should be set to this parameter's value. FieldPaths []string }
A Parameter may be used to set the supplied paths to the supplied value.
type ParameterResolveFn ¶
type ParameterResolveFn func([]v1alpha2.ComponentParameter, []v1alpha2.ComponentParameterValue) ([]Parameter, error)
A ParameterResolveFn resolves the parameters accepted by a component and the parameter values supplied to a component into configured parameters.
func (ParameterResolveFn) Resolve ¶
func (fn ParameterResolveFn) Resolve(cp []v1alpha2.ComponentParameter, cpv []v1alpha2.ComponentParameterValue) ([]Parameter, error)
Resolve the supplied parameters.
type ParameterResolver ¶
type ParameterResolver interface {
Resolve([]v1alpha2.ComponentParameter, []v1alpha2.ComponentParameterValue) ([]Parameter, error)
}
A ParameterResolver resolves the parameters accepted by a component and the parameter values supplied to a component into configured parameters.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
A Reconciler reconciles OAM ApplicationConfigurations by rendering and instantiating their Components and Traits.
func NewReconciler ¶
func NewReconciler(m ctrl.Manager, o ...ReconcilerOption) *Reconciler
NewReconciler returns a Reconciler that reconciles ApplicationConfigurations by rendering and instantiating their Components and Traits.
type ReconcilerOption ¶
type ReconcilerOption func(*Reconciler)
A ReconcilerOption configures a Reconciler.
func WithApplicator ¶
func WithApplicator(a WorkloadApplicator) ReconcilerOption
WithApplicator specifies how the Reconciler should apply workloads and traits.
func WithGarbageCollector ¶
func WithGarbageCollector(gc GarbageCollector) ReconcilerOption
WithGarbageCollector specifies how the Reconciler should garbage collect workloads and traits when an ApplicationConfiguration is edited to remove them.
func WithLogger ¶
func WithLogger(l 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 events.
func WithRenderer ¶
func WithRenderer(r ComponentRenderer) ReconcilerOption
WithRenderer specifies how the Reconciler should render workloads and traits.
type ResourceRenderFn ¶
type ResourceRenderFn func(data []byte, p ...Parameter) (*unstructured.Unstructured, error)
A ResourceRenderFn renders a Kubernetes-compliant YAML resource into an Unstructured object, optionally setting the supplied parameters.
func (ResourceRenderFn) Render ¶
func (fn ResourceRenderFn) Render(data []byte, p ...Parameter) (*unstructured.Unstructured, error)
Render the supplied Kubernetes YAML resource.
type ResourceRenderer ¶
type ResourceRenderer interface {
Render(data []byte, p ...Parameter) (*unstructured.Unstructured, error)
}
A ResourceRenderer renders a Kubernetes-compliant YAML resource into an Unstructured object, optionally setting the supplied parameters.
type Workload ¶
type Workload struct { // ComponentName that produced this workload. ComponentName string // A Workload object. Workload *unstructured.Unstructured // Traits associated with this workload. Traits []unstructured.Unstructured }
A Workload produced by an OAM ApplicationConfiguration.
func (Workload) Status ¶
func (w Workload) Status() v1alpha2.WorkloadStatus
Status produces the status of this workload and its traits, suitable for use in the status of an ApplicationConfiguration.