tracker

package
Version: v0.0.0-...-75da391 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package tracker defines a utility to enable Reconcilers to trigger reconciliations when objects that are cross-referenced change, so that the level-based reconciliation can react to the change. The prototypical cross-reference in Kubernetes is corev1.ObjectReference.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Track tells us that "obj" is tracking changes to the
	// referenced object.
	Track(ref corev1.ObjectReference, obj interface{}) error

	// OnChanged is a callback to register with the InformerFactory
	// so that we are notified for appropriate object changes.
	OnChanged(obj interface{})
}

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

func New

func New(callback func(string), lease time.Duration) Interface

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

When OnChanged is called by the informer for a particular GroupVersionKind, the provided callback is called with the "key" of each object actively watching the changed object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL