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 WatchControllerConfig(ctr controller.Controller, mgr manager.Manager) error
- type ControllerConfig
- func (wc *ControllerConfig) GetCheAPISidecarImage() string
- func (wc *ControllerConfig) GetDefaultRoutingClass() string
- func (wc *ControllerConfig) GetDefaultTerminalDockerimage() (*devworkspace.ContainerComponent, error)
- func (wc *ControllerConfig) GetPVCStorageClassName() *string
- func (wc *ControllerConfig) GetPluginArtifactsBrokerImage() string
- func (wc *ControllerConfig) GetPluginRegistry() 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) 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
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" DefaultPluginsVolumeName = "plugins" PluginsMountPath = "/plugins" AuthEnabled = "false" ServiceAccount = "devworkspace" SidecarDefaultMemoryLimit = "128M" PVCStorageSize = "1Gi" // WorkspaceIDLabel is label key to store workspace identifier WorkspaceIDLabel = "controller.devfile.io/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" // WorkspaceImmutableAnnotation 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. WorkspaceImmutableAnnotation = "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" )
Internal constants
View Source
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
View Source
const (
// The IDE of theia editor in devfile
TheiaEditorID = "eclipse/che-theia"
)
constants for workspace controller
Variables ¶
View Source
var ConfigMapReference = client.ObjectKey{
Namespace: "",
Name: "devworkspace-controller",
}
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 WatchControllerConfig ¶
func WatchControllerConfig(ctr controller.Controller, mgr manager.Manager) error
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.ContainerComponent, error)
func (*ControllerConfig) GetPVCStorageClassName ¶
func (wc *ControllerConfig) GetPVCStorageClassName() *string
func (*ControllerConfig) GetPluginArtifactsBrokerImage ¶
func (wc *ControllerConfig) GetPluginArtifactsBrokerImage() string
func (*ControllerConfig) GetPluginRegistry ¶
func (wc *ControllerConfig) GetPluginRegistry() 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) 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
Click to show internal directories.
Click to hide internal directories.