namespace

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

pkg/controllers/namespace/wiring.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NMSink

type NMSink struct {
	NM        *NamespaceController
	Resync    time.Duration
	Finalizer v1.FinalizerName
}

func (*NMSink) AddProject

func (s *NMSink) AddProject(ctx context.Context, id string, cfg *rest.Config) error

func (*NMSink) RemoveProject

func (s *NMSink) RemoveProject(id string)

type NamespaceController

type NamespaceController struct {
	// contains filtered or unexported fields
}

NamespaceController is responsible for performing actions dependent upon a namespace phase

func NewNamespaceController

func NewNamespaceController(
	ctx context.Context,
	kubeClient clientset.Interface,
	metadataClient metadata.Interface,
	discoverResourcesFn func() ([]*metav1.APIResourceList, error),
	namespaceInformer coreinformers.NamespaceInformer,
	resyncPeriod time.Duration,
	finalizerToken v1.FinalizerName,
) *NamespaceController

NewNamespaceController creates a multi-cluster-aware controller and wires the passed informer/client as the initial "root" cluster. If you want a different name, replace "root" with your desired ID.

func (*NamespaceController) AddProject

func (nm *NamespaceController) AddProject(
	parent context.Context,
	project string,
	kube clientset.Interface,
	md metadata.Interface,
	discover func() ([]*metav1.APIResourceList, error),
	resync time.Duration,
	finalizer v1.FinalizerName,
) error

func (*NamespaceController) RemoveProject

func (nm *NamespaceController) RemoveProject(project string)

func (*NamespaceController) Run

func (nm *NamespaceController) Run(ctx context.Context, workers int)

Run starts observing the system with the specified number of workers. NOTE: this multi-cluster version waits for the caches of all clusters that are registered at start. If you add clusters dynamically later, ensure AddCluster waits for its informer(s) to sync before they begin enqueueing.

Jump to

Keyboard shortcuts

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