Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NamespaceController ¶
type NamespaceController struct {
// contains filtered or unexported fields
}
NamespaceController is a controller that watches for Namespace events and sets a flag to indicate whether the Reconciler thread needs to reconcile for this namespace event.
func New ¶
func New(cl client.Client, state *State) *NamespaceController
New instantiates the namespace controller.
func (*NamespaceController) Reconcile ¶
func (nc *NamespaceController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile processes the Namespace request to set the flag to indicate whether a new reconciliation needs to be executed by the Reconciler thread.
func (*NamespaceController) SetupWithManager ¶
func (nc *NamespaceController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the Namespace Controller.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State stores the state of the Namespace Controller.
func (*State) ScheduleSync ¶
ScheduleSync checks whether the isSyncPending flag is true. If it is true, a sync should be scheduled by the reconciler thread, and it flips the internal flag to false. If it is false, no sync will be scheduled.
type UnmanagedNamespacePredicate ¶
UnmanagedNamespacePredicate triggers a new reconciliation of the namespace controller when receiving an unmanaged Namespace event.
func (UnmanagedNamespacePredicate) Create ¶
func (n UnmanagedNamespacePredicate) Create(e event.CreateEvent) bool
Create implements default CreateEvent filter for validating namespace with additional labels.
func (UnmanagedNamespacePredicate) Delete ¶
func (n UnmanagedNamespacePredicate) Delete(_ event.DeleteEvent) bool
Delete implements default DeleteEvent filter for validating namespace with additional labels.
func (UnmanagedNamespacePredicate) Generic ¶
func (n UnmanagedNamespacePredicate) Generic(e event.GenericEvent) bool
Generic implements Predicate.
func (UnmanagedNamespacePredicate) Update ¶
func (n UnmanagedNamespacePredicate) Update(e event.UpdateEvent) bool
Update implements default UpdateEvent filter for validating namespace label change.