Open dkwon17 opened 3 months ago
When creating a workspace with this DevWorkspace:
the workspace starts and container contributions do not happen.
In the example above, there is a undeclared variable {{test}} in the say-hello command.
{{test}}
say-hello
See usage of variables in devfile spec
che-code-runtime-description
Ideally, workspace start should fail with a descriptive error message in this case.
It's happening if the global variable validation fails here: https://github.com/devfile/devworkspace-operator/blob/4b2fcdabcc1b5f637d402feb98b6de3341d9f9dc/pkg/library/flatten/flatten.go#L64-L68
the function exits early without doing the container contributions and the workspace starts up without notifying the user.
Description
When creating a workspace with this DevWorkspace:
DevWorkspace CR
``` kind: DevWorkspace apiVersion: workspace.devfile.io/v1alpha2 metadata: name: code-latest spec: started: true template: projects: - name: web-nodejs-sample git: remotes: origin: "https://github.com/che-samples/web-nodejs-sample.git" components: - name: dev container: image: quay.io/devfile/universal-developer-image:latest memoryLimit: 512Mi memoryRequest: 256Mi cpuRequest: 1000m commands: - id: template: projects: - name: web-nodejs-sample git: remotes: origin: "https://github.com/che-samples/web-nodejs-sample.git" components: - name: dev container: image: quay.io/devfile/universal-developer-image:latest memoryLimit: 512Mi memoryRequest: 256Mi cpuRequest: 1000m commands: - id: say-hello exec: component: dev commandLine: echo "Hello {{test}} $(pwd)" workingDir: ${PROJECT_SOURCE}/app contributions: - name: che-code uri: https://eclipse-che.github.io/che-plugin-registry/main/v3/plugins/che-incubator/che-code/latest/devfile.yaml components: - name: che-code-runtime-description container: env: - name: CODE_HOST value: 0.0.0.0 ```the workspace starts and container contributions do not happen.
In the example above, there is a undeclared variable
{{test}}
in thesay-hello
command.See usage of variables in devfile spec
How To Reproduce
che-code-runtime-description
exists as it's own container in the pod:Expected behavior
Ideally, workspace start should fail with a descriptive error message in this case.
Additional context
It's happening if the global variable validation fails here: https://github.com/devfile/devworkspace-operator/blob/4b2fcdabcc1b5f637d402feb98b6de3341d9f9dc/pkg/library/flatten/flatten.go#L64-L68
the function exits early without doing the container contributions and the workspace starts up without notifying the user.