You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/additional-configuration.adoc
+65-1Lines changed: 65 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,7 +168,58 @@ When "file" is used, the configmap is mounted as a directory within the workspac
168
168
169
169
* `controller.devfile.io/mount-on-start`: when set to `"true"`, the resource will only be mounted when a workspace starts. If the resource is created while a workspace is already running, it will not be automatically mounted until the workspace is restarted. This prevents unwanted workspace restarts caused by newly created automount resources. This annotation can be applied to configmaps, secrets, and persistent volume claims.
170
170
+
171
-
For git credential secrets (labelled with `controller.devfile.io/git-credential`) and git TLS configmaps (labelled with `controller.devfile.io/git-tls-credential`), the annotation is evaluated across all git credential resources as a group, not individually. Since all git credentials are merged into a single mounted secret, if at least one git credential secret (or TLS configmap) lacks the `controller.devfile.io/mount-on-start` annotation, all git credentials (or TLS configmaps) will be mounted, including those marked with `mount-on-start`.
171
+
For git credential secrets (labeled with `controller.devfile.io/git-credential`)
172
+
and git TLS configmaps (labelled with `controller.devfile.io/git-tls-credential`),
173
+
this annotation behaves differently. The `controller.devfile.io/mount-on-start` annotation is evaluated across
174
+
all git credential resources as a group, not individually. Since all git credentials are
175
+
merged into a single mounted secret, if at least one git credential secret (or TLS configmap)
176
+
lacks the `controller.devfile.io/mount-on-start` annotation, all git credentials
177
+
(or TLS configmaps) will be mounted, including those marked with `controller.devfile.io/mount-on-start`.
178
+
179
+
* `controller.devfile.io/mount-to-devworkspace-include`: configure which DevWorkspaces the
180
+
resource should be mounted to. The value is a comma-separated list of patterns matched against
181
+
the DevWorkspace name. The resource is only mounted to workspaces whose name matches at
182
+
least one pattern. This annotation can be applied to ConfigMaps, Secrets and Persistent Volume Claims.
183
+
+
184
+
* `controller.devfile.io/mount-to-devworkspace-exclude`: configure which DevWorkspaces the
185
+
resource should NOT be mounted to. The value is a comma-separated list of patterns
186
+
matched against the DevWorkspace name. The resource is not mounted to workspaces whose name
187
+
matches any pattern. This annotation can be applied to ConfigMaps, Secrets and Persistent Volume Claims.
188
+
+
189
+
Supported patterns for both annotations:
190
+
+
191
+
--
192
+
**`name`-- exact match
193
+
**`name*`-- prefix match
194
+
**`*name`-- suffix match
195
+
**`\*name*`-- contains match
196
+
**`*`-- matches all workspaces
197
+
--
198
+
+
199
+
Both annotations can be used at the same time on the same resource. When both are present, the resource is mounted only to workspaces that match the include pattern AND do not match the exclude pattern.
200
+
If neither annotation is present, the resource is mounted to all workspaces (default behavior).
This will mount a file `/tmp/.git-credentials/credentials` in all workspace containers, and construct a git config to use this file as a credentials store.
203
254
255
+
### Using a base gitconfig
256
+
If an automount configmap or secret (labeled with `controller.devfile.io/automount: true`)
257
+
is mounted as `subpath` and contains a key that resolves to `/etc/gitconfig`,
258
+
its contents are used as the base git configuration for the workspace.
259
+
This base gitconfig is merged with the generated git credentials configuration.
260
+
261
+
For example, a configmap with `controller.devfile.io/mount-path: /etc` and a key named
262
+
`gitconfig` will be detected and used as the base git configuration.
263
+
264
+
The `controller.devfile.io/mount-to-devworkspace-include` and
265
+
`controller.devfile.io/mount-to-devworkspace-exclude` annotations are respected,
266
+
allowing the base gitconfig to be targeted to specific workspaces.
267
+
204
268
## Configuring DevWorkspaces to use SSH keys for Git operations
205
269
Git SSH keys can be configured for DevWorkspaces by mounting secrets to workspaces.
log.V(1).Info("Skipping ConfigMap, workspace does not match include/exclude annotations", "namespace", cm.Namespace, "name", cm.Name, "workspace", workspaceName)
log.V(1).Info("Skipping Secret, workspace does not match include/exclude annotations", "namespace", secret.Namespace, "name", secret.Name, "workspace", workspaceName)
0 commit comments