controller

package
v0.0.0-...-eaea543 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ControllerInitializers = map[string]InitFunc{
	"openshift.io/namespace-security-allocation":          RunNamespaceSecurityAllocationController,
	"openshift.io/resourcequota":                          RunResourceQuotaManager,
	"openshift.io/cluster-quota-reconciliation":           RunClusterQuotaReconciliationController,
	"openshift.io/cluster-csr-approver":                   RunCSRApproverController,
	"openshift.io/podsecurity-admission-label-syncer":     runPodSecurityAdmissionLabelSynchronizationController,
	"openshift.io/privileged-namespaces-psa-label-syncer": runPrivilegedNamespacesPSALabelSyncer,
}

Functions

func RunCSRApproverController

func RunCSRApproverController(ctx context.Context, controllerCtx *EnhancedControllerContext) (bool, error)

func RunClusterQuotaReconciliationController

func RunClusterQuotaReconciliationController(ctx context.Context, controllerCtx *EnhancedControllerContext) (bool, error)

func RunNamespaceSecurityAllocationController

func RunNamespaceSecurityAllocationController(ctx context.Context, controllerCtx *EnhancedControllerContext) (bool, error)

func RunResourceQuotaManager

func RunResourceQuotaManager(ctx context.Context, controllerCtx *EnhancedControllerContext) (bool, error)

Types

type ControllerClientBuilder

type ControllerClientBuilder interface {
	clientbuilder.ControllerClientBuilder

	OpenshiftSecurityClient(name string) (securityinternalclient.Interface, error)
	OpenshiftSecurityClientOrDie(name string) securityinternalclient.Interface

	OpenshiftImageClient(name string) (imageclient.Interface, error)
	OpenshiftImageClientOrDie(name string) imageclient.Interface

	OpenshiftQuotaClient(name string) (quotaclient.Interface, error)
	OpenshiftQuotaClientOrDie(name string) quotaclient.Interface
}

type EnhancedControllerContext

type EnhancedControllerContext struct {
	*controllercmd.ControllerContext
	OpenshiftControllerConfig openshiftcontrolplanev1.OpenShiftControllerManagerConfig

	// ClientBuilder will provide a client for this controller to use
	ClientBuilder ControllerClientBuilder

	KubernetesInformers informers.SharedInformerFactory
	MetadataInformers   metadatainformer.SharedInformerFactory

	QuotaInformers    quotainformer.SharedInformerFactory
	ImageInformers    imageinformer.SharedInformerFactory
	SecurityInformers securityinformer.SharedInformerFactory

	GenericResourceInformer genericinformers.GenericResourceInformer

	// InformersStarted is closed after all of the controllers have been initialized and are running.  After this point it is safe,
	// for an individual controller to start the shared informers. Before it is closed, they should not.
	InformersStarted chan struct{}
	// contains filtered or unexported fields
}

func (*EnhancedControllerContext) IsControllerEnabled

func (c *EnhancedControllerContext) IsControllerEnabled(name string) bool

func (*EnhancedControllerContext) StartInformers

func (c *EnhancedControllerContext) StartInformers(stopCh <-chan struct{})

func (*EnhancedControllerContext) ToGenericInformer

type InitFunc

type InitFunc func(ctx context.Context, controllerCtx *EnhancedControllerContext) (bool, error)

InitFunc is used to launch a particular controller. It may run additional "should I activate checks". Any error returned will cause the controller process to `Fatal` The bool indicates whether the controller was enabled.

type OpenshiftControllerClientBuilder

type OpenshiftControllerClientBuilder struct {
	clientbuilder.ControllerClientBuilder
}

func (OpenshiftControllerClientBuilder) OpenshiftImageClient

func (b OpenshiftControllerClientBuilder) OpenshiftImageClient(name string) (imageclient.Interface, error)

OpenshiftImageClient provides a REST client for the image API. If the client cannot be created because of configuration error, this function will error.

func (OpenshiftControllerClientBuilder) OpenshiftImageClientOrDie

func (b OpenshiftControllerClientBuilder) OpenshiftImageClientOrDie(name string) imageclient.Interface

OpenshiftImageClientOrDie provides a REST client for the image API. If the client cannot be created because of configuration error, this function will panic.

func (OpenshiftControllerClientBuilder) OpenshiftQuotaClient

func (b OpenshiftControllerClientBuilder) OpenshiftQuotaClient(name string) (quotaclient.Interface, error)

func (OpenshiftControllerClientBuilder) OpenshiftQuotaClientOrDie

func (b OpenshiftControllerClientBuilder) OpenshiftQuotaClientOrDie(name string) quotaclient.Interface

OpenshiftInternalBuildClientOrDie provides a REST client for the build API. If the client cannot be created because of configuration error, this function will panic.

func (OpenshiftControllerClientBuilder) OpenshiftSecurityClient

func (OpenshiftControllerClientBuilder) OpenshiftSecurityClientOrDie

func (b OpenshiftControllerClientBuilder) OpenshiftSecurityClientOrDie(name string) securityinternalclient.Interface

Jump to

Keyboard shortcuts

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