Chapter 2. Optional parameters for the URLs for starting a new workspace
Customize workspace creation by appending optional parameters to the URL that starts a new workspace.
When you open a Git repository URL in OpenShift Dev Spaces, you can add query parameters to control the IDE, workspace storage, resource limits, devfile path, and other workspace settings.
2.1. URL parameter concatenation Copy linkLink copied to clipboard!
Combine multiple URL parameters when starting an OpenShift Dev Spaces workspace by concatenating them with &. This enables you to customize the editor, storage type, devfile, and other workspace settings in a single URL.
Use the following URL syntax:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?<url_parameter_1>&<url_parameter_2>&<url_parameter_3>
For example, the following URL starts a new workspace with a Git repository, a specific editor, and a custom devfile path:
https://<openshift_dev_spaces_fqdn>#https://github.com/che-samples/cpp-hello-world?new&che-editor=che-incubator/intellij-community/latest&devfilePath=tests/testdevfile.yaml
Explanation of the parts of the URL:
https://<openshift_dev_spaces_fqdn>
#https://github.com/che-samples/cpp-hello-world
?new&che-editor=che-incubator/intellij-community/latest&devfilePath=tests/testdevfile.yaml
https://<openshift_dev_spaces_fqdn>- OpenShift Dev Spaces URL.
#https://github.com/…- The URL of the Git repository to be cloned into the new workspace.
?new&che-editor=…- The concatenated optional URL parameters.
2.2. URL parameter for the IDE Copy linkLink copied to clipboard!
The che-editor= URL parameter specifies a supported IDE when starting a workspace, allowing you to override the default editor or the che-editor.yaml file without modifying the Git repository.
Use the che-editor= parameter when you cannot add or edit a /.che/che-editor.yaml file in the source-code Git repository to be cloned for workspaces.
The che-editor= parameter overrides the /.che/che-editor.yaml file.
This parameter accepts two types of values:
che-editor=<editor_key>https://<openshift_dev_spaces_fqdn>#<git_repository_url>?che-editor=<editor_key>
| IDE | Status | editor_key value | Note |
|---|---|---|---|
| Available |
|
| |
| JetBrains IntelliJ IDEA Ultimate Edition (over JetBrains Gateway) | Available |
|
|
2.2.1. Using a URL to a file Copy linkLink copied to clipboard!
To start a workspace with an IDE defined by a URL to a file with devfile content, use the che-editor=<url_to_a_file> parameter:
pass:c,a,q[https://__<openshift_dev_spaces_fqdn>__#<git_repository_url>?che-editor=<url_to_a_file>]
- The URL must point to the raw file content.
-
To use this parameter with a
che-editor.yamlfile, copy the file with another name or path, and remove the line withinlinefrom the file.
2.3. URL parameter for the IDE image Copy linkLink copied to clipboard!
The editor-image URL parameter sets a custom IDE image for the workspace, allowing you to test prerelease IDE builds or use a customized IDE container.
-
If the Git repository contains
/.che/che-editor.yamlfile, the custom editor is overridden with the new IDE image. -
If there is no
/.che/che-editor.yamlfile in the Git repository, the default editor is overridden with the new IDE image. -
If you want to override the supported IDE and change the target editor image, you can use both parameters together:
che-editorandeditor-imageURL parameters.
The URL parameter to override the IDE image is editor-image=:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?editor-image=<container_registry/image_name:image_tag>
For example:
To start a workspace with a custom IDE image:
pass:c,a,q[https://__<openshift_dev_spaces_fqdn>__]#https://github.com/eclipse-che/che-docs?editor-image=quay.io/che-incubator/che-code:nextTo combine the
che-editorandeditor-imageparameters:pass:c,a,q[https://__<openshift_dev_spaces_fqdn>__]#https://github.com/eclipse-che/che-docs?che-editor=che-incubator/che-code/latest&editor-image=quay.io/che-incubator/che-code:next
2.4. URL parameter for starting duplicate workspaces Copy linkLink copied to clipboard!
Use the new URL parameter to create multiple workspaces from the same devfile and Git repository, which is useful when you need parallel environments for testing or comparing changes.
The URL parameter for starting a duplicate workspace is new:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?new
If you currently have a workspace that you started by using a URL, then visiting the URL again without the new URL parameter opens the existing workspace.
2.5. URL parameter for the existing workspace name Copy linkLink copied to clipboard!
Use the existing URL parameter to reopen an existing workspace instead of creating a new one, which avoids duplicate workspaces when revisiting a workspace URL.
Example 2.1. Example
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?existing=workspace_name
When specifying the existing URL parameter, following situations may arise:
- If there is no workspace created from the same URL, a new workspace is created.
- If the specified existing workspace name matches an existing workspace created from the same URL and the existing workspace is opened.
If the specified existing workspace name does not match any existing workspaces, a warning appears and you need to select one of the following actions:
- Create a new workspace.
- Select an existing workspace to open.
To create multiple workspaces from the same URL, you can use the new URL parameter:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?new
2.6. URL parameter for the devfile file name Copy linkLink copied to clipboard!
Use the df URL parameter to specify a custom devfile file name when the repository uses a name other than the default .devfile.yaml or devfile.yaml.
The URL parameter for specifying an unconventional file name of the devfile is df=<filename>.yaml:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?df=<filename>.yaml
df=<filename>.yaml-
<filename>.yamlis an unconventional file name of the devfile in the linked Git repository.
The df=<filename>.yaml parameter also has a long version: devfilePath=<filename>.yaml.
2.7. URL parameter for the devfile file path Copy linkLink copied to clipboard!
Use the devfilePath URL parameter to specify a custom path to the devfile when it is not in the root directory of the linked Git repository.
The URL parameter for specifying an unconventional file path of the devfile is devfilePath=<relative_file_path>:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?devfilePath=<relative_file_path>
devfilePath=<relative_file_path>-
<relative_file_path>is an unconventional file path of the devfile in the linked Git repository.
2.8. URL parameter for the workspace storage Copy linkLink copied to clipboard!
Use the storageType URL parameter to override the default storage strategy for a new workspace, choosing between persistent and ephemeral storage based on your data retention needs.
The URL parameter for specifying a storage type for a workspace is storageType=<storage_type>:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?storageType=<storage_type>
storageType=<storage_type>Possible
<storage_type>values:-
ephemeral -
per-user(persistent) -
per-workspace(persistent)
-
With the ephemeral or per-workspace storage type, you can run multiple workspaces concurrently, which is not possible with the default per-user storage type.
2.9. URL parameter for additional remotes Copy linkLink copied to clipboard!
Configure additional Git remotes when starting a workspace by specifying extra repository URLs as parameters, enabling work with multiple upstream sources in a single workspace.
The URL parameter for cloning and configuring additional remotes for the workspace is remotes=:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?remotes={{<name_1>,<url_1>},{<name_2>,<url_2>},{<name_3>,<url_3>},...}
-
If you do not enter the name
originfor any of the additional remotes, the remote from <git_repository_url> is cloned and namedoriginby default. Its expected branch is checked out automatically. -
If you enter the name
originfor one of the additional remotes, its default branch is checked out automatically. However, the remote from <git_repository_url> is NOT cloned for the workspace.
2.10. URL parameter for a container image Copy linkLink copied to clipboard!
The image URL parameter specifies a custom container image for the workspace, allowing you to use a different base image than the one defined in the devfile or the default Universal Developer Image.
The image parameter applies in the following scenarios:
- The Git repository contains no devfile, and you want to start a new workspace with the custom image.
-
The Git repository contains a devfile, and you want to override the first container image listed in the
componentssection of the devfile.
The URL parameter for the path to the container image is image=:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?image=<container_image_url>
For example:
https://<openshift_dev_spaces_fqdn>#https://github.com/eclipse-che/che-docs?image=quay.io/devfile/universal-developer-image:ubi9-latest
2.11. URL parameter for a memory limit Copy linkLink copied to clipboard!
The memoryLimit URL parameter specifies or overrides the container memory limit when starting a new workspace from a devfile URL. Use this parameter to allocate enough memory for resource-intensive development tasks.
The URL parameter for the memory limit is memoryLimit=:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?memoryLimit=<container_memory_limit>
You can specify the memory limit in bytes, or use a suffix such as Mi for mebibytes or Gi for gibibytes.
Example 2.2. Example
https://<openshift_dev_spaces_fqdn>#https://github.com/eclipse-che/che-docs?memoryLimit=4Gi
When you specify the memoryLimit parameter, it overrides the memory limit defined for the first container of the devfile.
The sum of the limits from the target devfile and from the editor definition is applied to the workspace pod spec.containers[0].resources.limits.memory.
2.12. URL parameter for a CPU limit Copy linkLink copied to clipboard!
The cpuLimit URL parameter specifies or overrides the container CPU limit when starting a new workspace from a devfile URL. Use this parameter to allocate enough CPU for resource-intensive development tasks.
The URL parameter for the CPU limit is cpuLimit=:
https://<openshift_dev_spaces_fqdn>#<git_repository_url>?cpuLimit=<container_cpu_limit>
You can specify the CPU limit in cores.
Example 2.3. Example
https://<openshift_dev_spaces_fqdn>#https://github.com/eclipse-che/che-docs?cpuLimit=2
When you specify the cpuLimit parameter, it overrides the CPU limit defined for the first container of the devfile.
The sum of the limits from the target devfile and from the editor definition is applied to the workspace pod spec.containers[0].resources.limits.cpu.