Help us shape the future of Go! Take the 2026 Go Developer Survey

processor

package
v0.13.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccumulatorAdd

func AccumulatorAdd(
	acc Accumulator,
	resource gvk.ResourceID,
	obj AccumulatorObject,
)

Types

type Accumulator

type Accumulator = map[string]*AccumulatorItem

Keeps track of generated items.

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
}

Keeps track of generated items.

type Processor

type Processor struct {
	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,
) (lastApply *metav1.Time, created bool, err error)

func (*Processor) Prune

func (r *Processor) Prune(
	ctx context.Context,
	c client.Client,
	obj *unstructured.Unstructured,
	fieldOwner string,
	current *meta.ObjectReferenceStatus,
) (deleted bool, err error)

Prune by reverting the patch by the given fieldOwner If the item was created by the controller and has no more field-managers we are going to delete.

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)

type ProcessorOptions

type ProcessorOptions struct {
	FieldOwnerPrefix string
	Prune            bool
	Adopt            bool
	Force            bool
	Owner            *metav1.OwnerReference
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL