remove

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterScopedOnRemoveHandler

func RegisterScopedOnRemoveHandler(ctx context.Context, controller Controller, name string, scopeFunc ScopeFunc, handler generic.Handler)

RegisterScopedOnRemoveHandler registers a handler that does the same thing as an OnRemove handler but only applies finalizers or sync logic to objects that pass the provided scopeFunc; this ensures that finalizers are not added to all resources across an entire cluster but are instead only scoped to resources that this controller is meant to watch.

TODO: move this to rancher/wrangler as a generic construct to be used across multiple controllers as part of the auto-generated code

Types

type Controller

type Controller interface {
	AddGenericHandler(ctx context.Context, name string, handler generic.Handler)
	Updater() generic.Updater
}

Controller is an interface that allows the ScopedOnRemoveHandler to register a generic RemoveHandler

type ScopeFunc

type ScopeFunc func(key string, obj runtime.Object) (bool, error)

ScopeFunc is a function that determines whether the ScopedOnRemoveHandler should manage the lifecycle of the given object

Jump to

Keyboard shortcuts

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