indexer

package
v0.22.15 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListOwnedBy added in v0.22.0

func ListOwnedBy(ctx context.Context, client ctrlclient.Client, list ctrlclient.ObjectList, nn types.NamespacedName, ownerType metav1.TypeMeta) error

List all the objects owned by the given object type.

This allows us to use owner-based indexing in tests without incurring the overhead of caching.

See discussion here: https://github.com/tilt-dev/tilt/issues/4719

Types

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

Helper struct to help reconcilers determine when to start their objects when a dependency triggers.

func NewIndexer

func NewIndexer(scheme *runtime.Scheme, f KeyFunc) *Indexer

func (*Indexer) Enqueue

func (m *Indexer) Enqueue(obj client.Object) []reconcile.Request

Given an update of a watched object, return the names of objects watching it that we need to reconcile.

func (*Indexer) EnqueueKey

func (m *Indexer) EnqueueKey(key Key) []reconcile.Request

Enqueue() when we don't have the full object, only the name and kind.

func (*Indexer) OnReconcile

func (m *Indexer) OnReconcile(name types.NamespacedName, obj client.Object)

Register the watched object for the given primary object.

type Key

type Key struct {
	Name types.NamespacedName
	GVK  schema.GroupVersionKind
}

A key to help index objects we watch.

type KeyFunc

type KeyFunc func(obj client.Object) []Key

Jump to

Keyboard shortcuts

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