tracker

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	GroupKind      schema.GroupKind
	NamespacedName types.NamespacedName
}

func NewKey

func NewKey(gvk schema.GroupVersionKind, namespacedName types.NamespacedName) Key

func (*Key) String

func (k *Key) String() string

type Tracker

type Tracker interface {
	// Track tells us that "obj" is tracking changes to the
	// referenced object.
	Track(ctx context.Context, ref Key, obj types.NamespacedName)

	// TrackChild tracks the child by the parent.
	TrackChild(ctx context.Context, parent, child client.Object, s *runtime.Scheme) error

	// Lookup returns actively tracked objects for the reference.
	Lookup(ctx context.Context, ref Key) []types.NamespacedName
}

Tracker defines the interface through which an object can register that it is tracking another object by reference.

func New

func New(lease time.Duration) Tracker

New returns an implementation of Tracker that lets a Reconciler register a particular resource as watching a resource for a particular lease duration. This watch must be refreshed periodically (e.g. by a controller resync) or it will expire.

Jump to

Keyboard shortcuts

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