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) GetCheAPISidecarImage() string
- 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) GetWebhooksEnabled() 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 ¶
const ( ConfigMapNameEnvVar = "CONTROLLER_CONFIG_MAP_NAME" ConfigMapNamespaceEnvVar = "CONTROLLER_CONFIG_MAP_NAMESPACE" )
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 = "32Mi" // 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
const ( // Attribute of Runtime Machine to mark source of the container. RestApisContainerSourceAttribute = "source" RestApisPluginMachineAttribute = "plugin" // Mark containers applied to workspace with help recipe definition. RestApisRecipeSourceContainerAttribute = "recipe" // Mark containers created workspace api like tooling for user development. RestApisRecipeSourceToolAttribute = "tool" // Command attribute which indicates the working directory where the given command must be run CommandWorkingDirectoryAttribute = "workingDir" // Command attribute which indicates in which machine command must be run. It is optional, // IDE should asks user to choose machine if null. CommandMachineNameAttribute = "machineName" // Command attribute which indicates in which plugin command must be run. If specified // plugin has multiple containers then first containers should be used. Attribute value has the // following format: `{PLUGIN_PUBLISHER}/{PLUGIN_NAME}/{PLUGIN_VERSION}`. For example: // eclipse/sample-plugin/0.0.1 CommandPluginAttribute = "plugin" // An attribute of the command to store the original path to the file that contains the editor // specific configuration. CommandActionReferenceAttribute = "actionReference" // The contents of editor-specific content CommandActionReferenceContentAttribute = "actionReferenceContent" // Workspace command attributes that indicates with which component it is associated. */ ComponentAliasCommandAttribute = "componentAlias" // RestAPIsRuntimeVolumePathis the path where workspace information is mounted in che-rest-apis RestAPIsRuntimeVolumePath = "/workspace/" // RestAPIsRuntimeJSONFilename is the filename for the runtime json annotation RestAPIsRuntimeJSONFilename = "runtime.json" // RestAPIsDevfileYamlFilename is the filename for the devfile yaml RestAPIsDevfileYamlFilename = "devfile.yaml" // RestAPIsVolumeName is the name of the configmap volume that stores workspace metadata RestAPIsVolumeName = "che-rest-apis-data" )
Constants for che-rest-apis
const (
// The IDE of theia editor in devfile
TheiaEditorID = "eclipse/che-theia"
)
constants for workspace controller
Variables ¶
var ConfigMapReference = client.ObjectKey{
Namespace: "",
Name: "devworkspace-controller-configmap",
}
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) GetCheAPISidecarImage ¶
func (wc *ControllerConfig) GetCheAPISidecarImage() string
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) GetWebhooksEnabled ¶
func (wc *ControllerConfig) GetWebhooksEnabled() 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{}