unmanageddetector

package
v1.127.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Predicate added in v1.114.0

type Predicate struct{}

Predicate is the predicate meant to be used by the unmanaged-detector controller. It sets up unmanaged-detector such that it handles Create events only.

func (Predicate) Create added in v1.114.0

func (Predicate) Create(_ event.CreateEvent) bool

func (Predicate) Delete added in v1.114.0

func (Predicate) Delete(_ event.DeleteEvent) bool

KCC controllers in general do not handle Delete events since resources deleted directly on the API server should not be reconciled. Instead, user-requested deletions are handled via the updated DeletionTimestamp. That is, user-requested deletions are handled via Update events, and as explained above, there is no scenario where unmanaged-detector would need to handle Update events.

func (Predicate) Generic added in v1.114.0

func (Predicate) Generic(_ event.GenericEvent) bool

func (Predicate) Update added in v1.114.0

func (Predicate) Update(_ event.UpdateEvent) bool

There is no scenario where unmanaged-detector would need to handle Update events.

Firstly, an Update event implies there had been a Create event already, which would have been handled by unmanaged-detector.

Secondly, once unmanaged-detector successfully reconciles a resource once, it never has to reconcile the resource again. This is because if the resource is marked Unmanaged, then unmanaged-detector's job is done: the onus is now on the user to create a ConfigConnectorContext. On the other hand, if the resource is determined to be managed, then unmanaged-detector's job is also done: it is not possible for a resource to later become unmanaged since ConfigConnectorContext deletions are blocked if there are resources in its namespace.

Even if the resource had been created before unmanaged-detector came online (e.g. if KCC is changed from cluster-mode to namespaced-mode), this is no problem as well since controllers reconcile all resources they are configured to watch when they first come up.

type Reconciler

type Reconciler struct {
	lifecyclehandler.LifecycleHandler
	// contains filtered or unexported fields
}

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req reconcile.Request) (res reconcile.Result, err error)

Jump to

Keyboard shortcuts

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