namespacecontroller

package
v1.17.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

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 NewState

func NewState() *State

NewState instantiates the namespace controller state.

func (*State) ScheduleSync

func (s *State) ScheduleSync() bool

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.

func (*State) SetSelectorCache

func (s *State) SetSelectorCache(nsSelectors map[string]labels.Selector, selectedNamespaces map[string][]labels.Selector)

SetSelectorCache is invoked by the reconciler to set the cache after parsing the NamespaceSelectors.

type UnmanagedNamespacePredicate

type UnmanagedNamespacePredicate struct {
	predicate.Funcs
}

UnmanagedNamespacePredicate triggers a new reconciliation of the namespace controller when receiving an unmanaged Namespace event.

func (UnmanagedNamespacePredicate) Create

Create implements default CreateEvent filter for validating namespace with additional labels.

func (UnmanagedNamespacePredicate) Delete

Delete implements default DeleteEvent filter for validating namespace with additional labels.

func (UnmanagedNamespacePredicate) Generic

Generic implements Predicate.

func (UnmanagedNamespacePredicate) Update

Update implements default UpdateEvent filter for validating namespace label change.

Jump to

Keyboard shortcuts

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