Documentation
¶
Index ¶
- func AccumulatorAdd(acc Accumulator, resource gvk.ResourceID, obj AccumulatorObject)
- type Accumulator
- type AccumulatorItem
- type AccumulatorObject
- type Processor
- func (r *Processor) Apply(ctx context.Context, c client.Client, obj *unstructured.Unstructured, ...) (ssa.ApplyResult, error)
- func (p *Processor) Prune(ctx context.Context, c client.Client, obj *unstructured.Unstructured, ...) (deleted bool, err error)
- func (p *Processor) Reconcile(ctx context.Context, log logr.Logger, c client.Client, ...) (err error)
- func (p *Processor) ReconcileNamespace(ctx context.Context, log logr.Logger, c client.Client, ...) (meta.ProcessedItems, error)
- type ProcessorOptions
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccumulatorAdd ¶
func AccumulatorAdd( acc Accumulator, resource gvk.ResourceID, obj AccumulatorObject, )
Types ¶
type AccumulatorItem ¶
type AccumulatorItem struct {
Resource gvk.ResourceID
Objects *[]AccumulatorObject
}
Keeps track of generated items.
type AccumulatorObject ¶
type AccumulatorObject struct {
Origin gvk.TenantResourceIDWithOrigin
Object *unstructured.Unstructured
Policy *apiruntime.ResourceReplicationPolicy
}
Keeps track of generated items.
type Processor ¶
type Processor struct {
ReplicationOwners ssa.ReplicationOwnerResolver
Conditions celruntime.ResourceConditionCompiler
Configuration configuration.Configuration
AllowCrossNamespaceSelection bool
GatherClient client.Reader
Mapper k8smeta.RESTMapper
}
func (*Processor) Apply ¶
func (r *Processor) Apply( ctx context.Context, c client.Client, obj *unstructured.Unstructured, fieldOwner string, force bool, adopt bool, ownerreference *metav1.OwnerReference, current *meta.ObjectReferenceStatus, policy *apiruntime.ResourceReplicationPolicy, ) (ssa.ApplyResult, error)
func (*Processor) Prune ¶
func (p *Processor) Prune( ctx context.Context, c client.Client, obj *unstructured.Unstructured, fieldOwner string, current *meta.ObjectReferenceStatus, owner *metav1.OwnerReference, ) (deleted bool, err error)
Prune relinquishes the fields owned by fieldOwner and deletes resources which were created exclusively for this processor item.
func (*Processor) Reconcile ¶
func (p *Processor) Reconcile( ctx context.Context, log logr.Logger, c client.Client, processed *meta.ProcessedItems, acc Accumulator, opts ProcessorOptions, ) (err error)
func (*Processor) ReconcileNamespace ¶ added in v0.14.0
func (p *Processor) ReconcileNamespace( ctx context.Context, log logr.Logger, c client.Client, current meta.ProcessedItems, acc Accumulator, opts ProcessorOptions, scope Scope, ) (meta.ProcessedItems, error)
ReconcileNamespace applies the accumulated items targeting a single Namespace of a single Tenant, returning the processed items of that scope only.
Contrarily to Reconcile, the given Accumulator is not authoritative for the whole Tenant: nothing is pruned, nor disowned, since the items missing from it may just belong to a Namespace this run knows nothing about. Pruning remains a duty of the full reconciliation.
The returned items are meant to be grafted on the persisted status through meta.ProcessedItems.ReplaceScope, which leaves the other Namespaces untouched. They are returned along an error too, since they carry the outcome of the single items which have been processed.