Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(mgr manager.Manager, crd *apiextensions.CustomResourceDefinition) error
Types ¶
type Reconciler ¶
type Reconciler struct { lifecyclehandler.LifecycleHandler // contains filtered or unexported fields }
func NewReconciler ¶
func NewReconciler(mgr manager.Manager, crd *apiextensions.CustomResourceDefinition) (*Reconciler, error)
type UnmanagedDetectorPredicate ¶
type UnmanagedDetectorPredicate struct{}
UnmanagedDetectorPredicate 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 (UnmanagedDetectorPredicate) Create ¶
func (UnmanagedDetectorPredicate) Create(_ event.CreateEvent) bool
func (UnmanagedDetectorPredicate) Delete ¶
func (UnmanagedDetectorPredicate) 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 (UnmanagedDetectorPredicate) Generic ¶
func (UnmanagedDetectorPredicate) Generic(_ event.GenericEvent) bool
func (UnmanagedDetectorPredicate) Update ¶
func (UnmanagedDetectorPredicate) 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 successfuly 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.