Documentation
¶
Overview ¶
Package static provides an unstructured resource primitive for static Kubernetes objects that do not model convergence health, grace periods, or suspension.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is a configuration helper for creating and customizing a static unstructured Resource.
It provides a fluent API for registering mutations and data extractors. Build() validates the configuration and returns an initialized Resource ready for use in a reconciliation loop.
func NewBuilder ¶
func NewBuilder(obj *uns.Unstructured) *Builder
NewBuilder initializes a new Builder with the provided unstructured object.
The object serves as the desired base state. During reconciliation the Resource will make the cluster's state match this base, modified by any registered mutations.
The provided object must have a Name set. Namespaced resources must also have a Namespace; cluster-scoped resources must call MarkClusterScoped.
func (*Builder) Build ¶
Build validates the configuration and returns the initialized Resource.
It returns an error if:
- No object was provided.
- The object is missing a Name.
- A namespaced object is missing a Namespace (and MarkClusterScoped was not called).
- A cluster-scoped object has a Namespace set.
func (*Builder) MarkClusterScoped ¶
MarkClusterScoped marks the resource as cluster-scoped. Build() will reject a non-empty namespace instead of requiring one.
func (*Builder) WithDataExtractor ¶
func (b *Builder) WithDataExtractor(extractor func(uns.Unstructured) error) *Builder
WithDataExtractor registers a function to read values from the object after it has been successfully reconciled.
The extractor receives a value copy of the reconciled object. A nil extractor is ignored.
func (*Builder) WithMutation ¶
WithMutation registers a mutation for the unstructured object.
Mutations are applied sequentially during the Mutate() phase of reconciliation. A mutation with a nil Feature is applied unconditionally; one with a non-nil Feature is applied only when that feature is enabled.
type Resource ¶
type Resource struct {
// contains filtered or unexported fields
}
Resource is a high-level abstraction for managing a static unstructured Kubernetes object within a controller's reconciliation loop.
It implements the following interfaces:
- component.Resource: for basic identity and mutation behaviour.
- concepts.DataExtractable: for exporting values after successful reconciliation.
Static unstructured resources do not model convergence health, grace periods, or suspension. Use the workload, integration, or task unstructured variants for resources that require those concepts.
func (*Resource) ExtractData ¶
ExtractData executes all registered data extractor functions against a deep copy of the reconciled object.
func (*Resource) Identity ¶
Identity returns a unique identifier for the resource derived from its GVK, namespace, and name.