Documentation
¶
Overview ¶
Package config is used by components to get configuration.
Typically each configuration property has the default value. Default value is supposed to be overridden via config map.
There is the following configuration names convention: - words are lower-cased - . is used to separate subcomponents - _ is used to separate words in the component name
Index ¶
- Constants
- Variables
- func GetDevModeEnabled() bool
- func GetWebhooksCertName() (string, error)
- func GetWebhooksSecretName() (string, error)
- func SetupConfigForTesting(cm *corev1.ConfigMap)
- func WatchControllerConfig(mgr manager.Manager) error
- type ControllerConfig
- func (wc *ControllerConfig) GetDefaultRoutingClass() string
- func (wc *ControllerConfig) GetDefaultTerminalDockerimage() (*devworkspace.Component, error)
- func (wc *ControllerConfig) GetExperimentalFeaturesEnabled() bool
- func (wc *ControllerConfig) GetPVCStorageClassName() *string
- func (wc *ControllerConfig) GetProperty(name string) *string
- func (wc *ControllerConfig) GetPropertyOrDefault(name string, defaultValue string) string
- func (wc *ControllerConfig) GetRoutingSuffix() string
- func (wc *ControllerConfig) GetSidecarPullPolicy() string
- func (wc *ControllerConfig) GetTlsInsecureSkipVerify() string
- func (wc *ControllerConfig) GetWorkspaceControllerSA() (string, error)
- func (wc *ControllerConfig) GetWorkspaceIdleTimeout() string
- func (wc *ControllerConfig) GetWorkspacePVCName() string
- func (wc *ControllerConfig) IsOpenShift() bool
- func (wc *ControllerConfig) SetIsOpenShift(isOpenShift bool)
- func (wc *ControllerConfig) Validate() error
- type ControllerEnv
Constants ¶
View Source
const ( ConfigMapNameEnvVar = "CONTROLLER_CONFIG_MAP_NAME" ConfigMapNamespaceEnvVar = "CONTROLLER_CONFIG_MAP_NAMESPACE" )
View Source
const ( // default URL for accessing Che Rest API Emulator from Workspace containers DefaultApiEndpoint = "http://localhost:9999/api/" DefaultProjectsSourcesRoot = "/projects" AuthEnabled = "false" ServiceAccount = "devworkspace" SidecarDefaultMemoryLimit = "128M" PVCStorageSize = "1Gi" // WorkspaceIDLabel is label key to store workspace identifier WorkspaceIDLabel = "controller.devfile.io/workspace_id" // WorkspaceIDLoggerKey is the key used to log workspace ID in the reconcile WorkspaceIDLoggerKey = "workspace_id" // WorkspaceEndpointNameAnnotation is the annotation key for storing an endpoint's name from the devfile representation WorkspaceEndpointNameAnnotation = "controller.devfile.io/endpoint_name" // WorkspaceNameLabel is label key to store workspace name WorkspaceNameLabel = "controller.devfile.io/workspace_name" // WorkspaceCreatorLabel is the label key for storing the UID of the user who created the workspace WorkspaceCreatorLabel = "controller.devfile.io/creator" // WorkspaceRestrictedAccessAnnotation marks the intention that workspace access is restricted to only the creator; setting this // annotation will cause workspace start to fail if webhooks are disabled. // Operator also propagates it to the workspace-related objects to perform authorization. WorkspaceRestrictedAccessAnnotation = "controller.devfile.io/restricted-access" // WorkspaceDiscoverableServiceAnnotation marks a service in a workspace as created for a discoverable endpoint, // as opposed to a service created to support the workspace itself. WorkspaceDiscoverableServiceAnnotation = "controller.devfile.io/discoverable-service" // ControllerServiceAccountNameEnvVar stores the name of the serviceaccount used in the controller. ControllerServiceAccountNameEnvVar = "CONTROLLER_SERVICE_ACCOUNT_NAME" // WorkspaceStopReasonAnnotation marks the reason why the workspace was stopped; when a workspace is restarted // this annotation will be cleared WorkspaceStopReasonAnnotation = "controller.devfile.io/stopped-by" // PVCCleanupPodMemoryLimit is the memory limit used for PVC clean up pods PVCCleanupPodMemoryLimit = "100Mi" // PVCCleanupPodMemoryRequest is the memory request used for PVC clean up pods PVCCleanupPodMemoryRequest = "32Mi" // PVCCleanupPodCPULimit is the cpu limit used for PVC clean up pods PVCCleanupPodCPULimit = "50m" // PVCCleanupPodCPURequest is the cpu request used for PVC clean up pods PVCCleanupPodCPURequest = "5m" // RoutingAnnotationInfix is the infix of the annotations of DevWorkspace that are passed down as annotation to the WorkspaceRouting objects. // The full annotation name is supposed to be "<routingClass>.routing.controller.devfile.io/<anything>" RoutingAnnotationInfix = ".routing.controller.devfile.io/" )
Internal constants
Variables ¶
View Source
var ConfigMapReference = client.ObjectKey{
Namespace: "",
Name: "devworkspace-controller-configmap",
}
View Source
var ControllerAppLabels = func() map[string]string { return map[string]string{ "app.kubernetes.io/name": "devworkspace-controller", "app.kubernetes.io/part-of": "devworkspace-operator", } }
Labels which should be used for controller related objects
Functions ¶
func GetDevModeEnabled ¶
func GetDevModeEnabled() bool
func GetWebhooksCertName ¶
func GetWebhooksSecretName ¶
func SetupConfigForTesting ¶
func WatchControllerConfig ¶
Types ¶
type ControllerConfig ¶
type ControllerConfig struct {
// contains filtered or unexported fields
}
var ControllerCfg ControllerConfig
func (*ControllerConfig) GetDefaultRoutingClass ¶
func (wc *ControllerConfig) GetDefaultRoutingClass() string
func (*ControllerConfig) GetDefaultTerminalDockerimage ¶
func (wc *ControllerConfig) GetDefaultTerminalDockerimage() (*devworkspace.Component, error)
func (*ControllerConfig) GetExperimentalFeaturesEnabled ¶
func (wc *ControllerConfig) GetExperimentalFeaturesEnabled() bool
GetExperimentalFeaturesEnabled returns true if experimental features should be enabled. DO NOT TURN ON IT IN THE PRODUCTION. Experimental features are not well tested and may be totally removed without announcement.
func (*ControllerConfig) GetPVCStorageClassName ¶
func (wc *ControllerConfig) GetPVCStorageClassName() *string
func (*ControllerConfig) GetProperty ¶
func (wc *ControllerConfig) GetProperty(name string) *string
func (*ControllerConfig) GetPropertyOrDefault ¶
func (wc *ControllerConfig) GetPropertyOrDefault(name string, defaultValue string) string
func (*ControllerConfig) GetRoutingSuffix ¶
func (wc *ControllerConfig) GetRoutingSuffix() string
func (*ControllerConfig) GetSidecarPullPolicy ¶
func (wc *ControllerConfig) GetSidecarPullPolicy() string
func (*ControllerConfig) GetTlsInsecureSkipVerify ¶
func (wc *ControllerConfig) GetTlsInsecureSkipVerify() string
func (*ControllerConfig) GetWorkspaceControllerSA ¶
func (wc *ControllerConfig) GetWorkspaceControllerSA() (string, error)
func (*ControllerConfig) GetWorkspaceIdleTimeout ¶
func (wc *ControllerConfig) GetWorkspaceIdleTimeout() string
func (*ControllerConfig) GetWorkspacePVCName ¶
func (wc *ControllerConfig) GetWorkspacePVCName() string
func (*ControllerConfig) IsOpenShift ¶
func (wc *ControllerConfig) IsOpenShift() bool
func (*ControllerConfig) SetIsOpenShift ¶
func (wc *ControllerConfig) SetIsOpenShift(isOpenShift bool)
func (*ControllerConfig) Validate ¶
func (wc *ControllerConfig) Validate() error
type ControllerEnv ¶
type ControllerEnv struct{}
Click to show internal directories.
Click to hide internal directories.