controller

package
Version: v0.0.0-...-c7201ed Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 51 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,
}

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

	OpenshiftAppsClient(name string) (appsclient.Interface, error)
	OpenshiftAppsClientOrDie(name string) appsclient.Interface

	OpenshiftBuildClient(name string) (buildclient.Interface, error)
	OpenshiftBuildClientOrDie(name string) buildclient.Interface

	OpenshiftConfigClient(name string) (configclient.Interface, error)
	OpenshiftConfigClientOrDie(name string) configclient.Interface

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

	// OpenShift clients based on generated internal clientsets
	OpenshiftTemplateClient(name string) (templateclient.Interface, error)
	OpenshiftTemplateClientOrDie(name string) templateclient.Interface

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

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

	OpenshiftOperatorClient(name string) (operatorclient.Interface, error)
	OpenshiftOperatorClientOrDie(name string) operatorclient.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

	TemplateInformers templateinformer.SharedInformerFactory
	QuotaInformers    quotainformer.SharedInformerFactory
	RouteInformers    routeinformer.SharedInformerFactory

	AppsInformers     appsinformer.SharedInformerFactory
	BuildInformers    buildinformer.SharedInformerFactory
	ConfigInformers   configinformer.SharedInformerFactory
	ImageInformers    imageinformer.SharedInformerFactory
	OperatorInformers operatorinformer.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) OpenshiftAppsClient

func (b OpenshiftControllerClientBuilder) OpenshiftAppsClient(name string) (appsclient.Interface, error)

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

func (OpenshiftControllerClientBuilder) OpenshiftAppsClientOrDie

func (b OpenshiftControllerClientBuilder) OpenshiftAppsClientOrDie(name string) appsclient.Interface

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

func (OpenshiftControllerClientBuilder) OpenshiftBuildClient

func (b OpenshiftControllerClientBuilder) OpenshiftBuildClient(name string) (buildclient.Interface, error)

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

func (OpenshiftControllerClientBuilder) OpenshiftBuildClientOrDie

func (b OpenshiftControllerClientBuilder) OpenshiftBuildClientOrDie(name string) buildclient.Interface

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

func (OpenshiftControllerClientBuilder) OpenshiftConfigClient

func (b OpenshiftControllerClientBuilder) OpenshiftConfigClient(name string) (configclient.Interface, error)

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

func (OpenshiftControllerClientBuilder) OpenshiftConfigClientOrDie

func (b OpenshiftControllerClientBuilder) OpenshiftConfigClientOrDie(name string) configclient.Interface

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

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) OpenshiftOperatorClient

func (b OpenshiftControllerClientBuilder) OpenshiftOperatorClient(name string) (operatorclient.Interface, error)

func (OpenshiftControllerClientBuilder) OpenshiftOperatorClientOrDie

func (b OpenshiftControllerClientBuilder) OpenshiftOperatorClientOrDie(name string) operatorclient.Interface

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

func (OpenshiftControllerClientBuilder) OpenshiftTemplateClient

func (b OpenshiftControllerClientBuilder) OpenshiftTemplateClient(name string) (templateclient.Interface, error)

OpenshiftInternalTemplateClient provides a REST client for the template API. If the client cannot be created because of configuration error, this function will return an error.

func (OpenshiftControllerClientBuilder) OpenshiftTemplateClientOrDie

func (b OpenshiftControllerClientBuilder) OpenshiftTemplateClientOrDie(name string) templateclient.Interface

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

Jump to

Keyboard shortcuts

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