watcher

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Watch

func Watch(ctx context.Context, watcher watch.Interface, actions ...ActionFunc) error

func WatchManagedObjects

func WatchManagedObjects(ctx context.Context, obj runtime.Object, mgr manager.Manager, action InfiniteActionFunc) error

func WatchObject

func WatchObject(ctx context.Context, obj runtime.Object, mgr manager.Manager, logger *logrus.Entry, action ActionFunc) error

func WatchObjects

func WatchObjects(
	ctx context.Context, watchClient Watcher,
	labelSelector, fieldSelector string,
	actions ...ActionFunc,
) error

func WatchSingleObject

func WatchSingleObject(ctx context.Context, watchClient Watcher, obj metav1.Object, actions ...ActionFunc) error

WatchSingleObject watches changes of the given object, and apply the registered actions for every change

Types

type ActionFunc

type ActionFunc func(obj runtime.Object) (done bool, err error)

type ActionFuncs

type ActionFuncs []ActionFunc

type ActionReconciler

type ActionReconciler struct {
	client.Client
	Action ActionFunc
	Type   runtime.Object
	Done   func()

	Logger *logrus.Entry
	// contains filtered or unexported fields
}

func (*ActionReconciler) InjectClient

func (r *ActionReconciler) InjectClient(c client.Client) error

func (*ActionReconciler) Reconcile

func (r *ActionReconciler) Reconcile(req reconcile.Request) (reconcile.Result, error)

type EnqueueRequestForObject

type EnqueueRequestForObject struct{}

func (*EnqueueRequestForObject) Create

Create implements EventHandler

func (*EnqueueRequestForObject) Delete

Delete implements EventHandler

func (*EnqueueRequestForObject) Generic

Generic implements EventHandler

func (*EnqueueRequestForObject) Update

Update implements EventHandler

type InfiniteActionFunc

type InfiniteActionFunc func(obj runtime.Object) error

type Watcher

type Watcher interface {
	Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
}

Jump to

Keyboard shortcuts

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