Documentation
¶
Index ¶
- func NewInputRevisions(obj client.Object, refKey string) *apiv1.InputRevisions
- func Slice(comp *apiv1.Composition, previous []*apiv1.ResourceSlice, ...) ([]*apiv1.ResourceSlice, error)
- type Cache
- func (c *Cache) Fill(ctx context.Context, comp types.NamespacedName, synUUID string, ...)
- func (c *Cache) Get(ctx context.Context, synthesisUUID string, ref Ref) (res *Resource, visible, found bool)
- func (c *Cache) Purge(ctx context.Context, compNSN types.NamespacedName, comp *apiv1.Composition)
- func (c *Cache) SetQueue(queue workqueue.TypedRateLimitingInterface[Request])
- func (c *Cache) Visit(ctx context.Context, comp *apiv1.Composition, synUUID string, ...) bool
- type ManifestRef
- type Ref
- type Request
- type Resource
- func (r *Resource) Deleted(comp *apiv1.Composition) bool
- func (r *Resource) FindStatus(slice *apiv1.ResourceSlice) *apiv1.ResourceState
- func (r *Resource) Less(than *Resource) bool
- func (r *Resource) Merge(ctx context.Context, old *Resource, current *unstructured.Unstructured, ...) (*unstructured.Unstructured, bool, error)
- func (r *Resource) NeedsToBePatched(current *unstructured.Unstructured) bool
- func (l *Resource) ObserveReconciliation() time.Duration
- func (r *Resource) Parse() (*unstructured.Unstructured, error)
- type SchemaGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInputRevisions ¶ added in v0.0.10
func NewInputRevisions(obj client.Object, refKey string) *apiv1.InputRevisions
func Slice ¶
func Slice(comp *apiv1.Composition, previous []*apiv1.ResourceSlice, outputs []*unstructured.Unstructured, maxJsonBytes int) ([]*apiv1.ResourceSlice, error)
Slice builds a new set of resource slices by merging a new set of resources onto an old set of slices. - New and updated resources are partitioned across slices per maxJsonBytes - Removed resources are converted into "tombstones" i.e. manifests with Deleted == true
Types ¶
type Cache ¶ added in v0.0.48
type Cache struct {
// contains filtered or unexported fields
}
Cache caches resources indexed and logically grouped by the UUID of the synthesis that produced them. Kind of like an informer but optimized for Eno.
func (*Cache) Fill ¶ added in v0.0.48
func (c *Cache) Fill(ctx context.Context, comp types.NamespacedName, synUUID string, items []apiv1.ResourceSlice)
Fill populates the cache with resources from a synthesis. Call Visit first to see if filling the cache is necessary. Get the resource slices from the API - not the informers, which prune out the manifests to save memory.
func (*Cache) Purge ¶ added in v0.0.48
func (c *Cache) Purge(ctx context.Context, compNSN types.NamespacedName, comp *apiv1.Composition)
Purge removes all syntheses from the cache that are not part of the given composition. If comp is nil, all syntheses will be purged.
func (*Cache) SetQueue ¶ added in v0.0.48
func (c *Cache) SetQueue(queue workqueue.TypedRateLimitingInterface[Request])
func (*Cache) Visit ¶ added in v0.0.48
func (c *Cache) Visit(ctx context.Context, comp *apiv1.Composition, synUUID string, items []apiv1.ResourceSlice) bool
Visit takes a set of resource slices from the informers and updates the resource status in the cache. Return false if the synthesis is not in the cache.
type ManifestRef ¶ added in v0.0.7
type ManifestRef struct { Slice types.NamespacedName Index int // position of this manifest within the slice }
ManifestRef references a particular resource manifest within a resource slice.
type Ref ¶
type Ref struct {
Name, Namespace, Group, Kind string
}
Ref refers to a specific synthesized resource.
type Request ¶ added in v0.0.48
type Request struct { Resource Ref Composition types.NamespacedName }
type Resource ¶
type Resource struct { Ref Ref Manifest *apiv1.Manifest ManifestRef ManifestRef ReconcileInterval *metav1.Duration GVK schema.GroupVersionKind ReadinessChecks readiness.Checks Patch jsonpatch.Patch DisableUpdates bool ReadinessGroup int // DefinedGroupKind is set on CRDs to represent the resource type they define. DefinedGroupKind *schema.GroupKind // contains filtered or unexported fields }
Resource is the controller's internal representation of a single resource out of a ResourceSlice.
func NewResource ¶
func (*Resource) FindStatus ¶ added in v0.0.7
func (r *Resource) FindStatus(slice *apiv1.ResourceSlice) *apiv1.ResourceState
func (*Resource) Less ¶ added in v0.0.47
Less returns true when r < than. Used to establish determinstic ordering for conflicting resources.
func (*Resource) Merge ¶ added in v0.0.45
func (r *Resource) Merge(ctx context.Context, old *Resource, current *unstructured.Unstructured, sg SchemaGetter) (*unstructured.Unstructured, bool, error)
Merge performs a three-way merge between the resource, it's old/previous Resource, and the current state. Falls back to a non-structured three-way merge if the SchemaGetter returns a nil TypeRef.
func (*Resource) NeedsToBePatched ¶ added in v0.0.6
func (r *Resource) NeedsToBePatched(current *unstructured.Unstructured) bool
func (*Resource) ObserveReconciliation ¶
func (*Resource) Parse ¶
func (r *Resource) Parse() (*unstructured.Unstructured, error)