question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to start workspaces using devfile spec v2.1.0

See original GitHub issue

Describe the bug

image

When I try to start a workspace using a factory link it fails with “Failed to resolve a devfile.”

Che version

Nightly

Steps to reproduce

Deploy Che, on OpenShift, with devworkspace support enabled

$ cat patch.yaml
spec:
  devWorkspace:
    enable: true
$ chectl server:deploy --che-operator-cr-patch-yaml=patch.yaml \
                     -p openshift --no-olm-suggested-namespace \
                     -n workspaces-server

Open a factory link

open ${CHE_URL}/#https://github.com/l0rd/spring-petclinic/                     # <== devfile v2 
open ${CHE_URL}/#https://github.com/l0rd/spring-petclinic/tree/che-happy-path  # <== devfile v1

Runtime

OpenShift 4.7.1

Installation method

$ chectl version
chectl/0.0.20210315-next.19bcb80 darwin-x64 node-v12.21.0

Environment

OpenShift dev cluster

More screenshots

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
sleshchenkocommented, Mar 17, 2021

our check is basically the regex 2..*.

to be honest, that check is done only when we fetch Devfile via ID or URI(devfile plugin component), but the goal is to rework it to DevWorkspaceTemplate, or both.

DevWorkspace CRD itself does not have schemaVersion at all(since it’s devfile metadata which is not part of devfile which is included into devworkspace.spec.template). DevWorkspace CRD has only the following versions:

Go side just ignore unknown fields, but kubectl does validation and throw an error when unknown field is used, and tell how to skip validation. So, technically dashboard should also warn user if validation is failed.

Kubectl validation details
~/pro/devworkspace-operator main <11 *14 !6 > kc apply -v 7 -f ./samples/flattened_theia-nodejs.yaml             INT 10:59:44
I0317 10:59:47.861929   29992 loader.go:375] Config loaded from file:  /home/sleshche/.kube/config
I0317 10:59:47.862714   29992 round_trippers.go:420] GET https://api.cluster-7c25.7c25.sandbox925.opentlc.com:6443/openapi/v2?timeout=32s
I0317 10:59:47.862732   29992 round_trippers.go:427] Request Headers:
I0317 10:59:47.862740   29992 round_trippers.go:431]     Accept: application/com.github.proto-openapi.spec.v2@v1.0+protobuf
I0317 10:59:47.862748   29992 round_trippers.go:431]     Authorization: Bearer <masked>
I0317 10:59:47.862753   29992 round_trippers.go:431]     User-Agent: kc/v1.19.4 (linux/amd64) kubernetes/d360454
I0317 10:59:48.106081   29992 round_trippers.go:446] Response Status: 200 OK in 243 milliseconds
F0317 10:59:48.430956   29992 helpers.go:115] error: error validating "./samples/flattened_theia-nodejs.yaml": error validating data: ValidationError(DevWorkspace.spec.template.components[3].volume): unknown field "ephemeral" in io.devfile.workspace.v1alpha2.DevWorkspace.spec.template.components.volume; if you choose to ignore these errors, turn validation off with --validate=false
1reaction
amisevskcommented, Mar 16, 2021

We’ve thus far been rolling with whatever the latest schemaVersion for devfile 2.x is. Since 2.x is supposed to be backwards compatible, our check is basically the regex 2\..*.

However, on the Go side, trying to deserialize unknown fields isn’t an error – if DWO supports only 2.0 (no cpuLimit) they’ll just be ignored if you throw a 2.1.0 devfile at it. Since we don’t have a full 2.1.0 release yet, currently DWO supports devfile features as of commit https://github.com/devfile/api/commit/283b0c54946e9fea9872c25e1e086c303688f0e8, which is in-line with a 2.1.0-alpha.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 4. Authoring devfiles - Red Hat Customer Portal
This section explains the concept of a devfile and how to configure a CodeReady Workspaces workspace by using a devfile of the 1.0...
Read more >
Introduction to Devfile - GitHub Pages
A list of commands: actions to manage the workspace components like running the dev tools, starting the runtime environments etc… Example of the...
Read more >
Devfile v2 and IDE plug-ins in Eclipse Che - Medium
1.0 specification. Devfile v1 were handled by Eclipse Che Server workspace engine using Java/Kubernetes API. There is a new engine for devfile ......
Read more >
Devfile v2 and IDE plug-ins - Eclipse Che Blog
1.0 specification. Devfiles v1 were handled by Eclipse Che Server workspace engine using Java/Kubernetes API. There is a new engine for v2 ......
Read more >
VS Code and IntelliJ with CodeReady Workspaces v2 ... - l0rd.io
The Devfile is a CNCF Sandbox project and the full specification of the file format is here. A simple devfile as the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found