eclipse-che / che-theia

Eclipse Public License 2.0
125 stars 111 forks source link

fix: edit command when entrypoint is tweaked #1343

Open dkwon17 opened 2 years ago

dkwon17 commented 2 years ago

Signed-off-by: David Kwon dakwon@redhat.com

What does this PR do?

When starting a workspace with devfilev2 with che-theia, the entrypoint (the args attribute) of the dev container component is modified if vscode extensions are present. If the dev container has a command attribute, the container may fail to run, and the workspace Pod would terminate with a CrashLoopBackOff error.

To reproduce the error, go to CHEHOST#https://github.com/eclipse-che/che-theia. The v1->v2 conversion library successfully converts the devfilev1 to devfilev2, but since we have a command defined in the dev container: https://github.com/eclipse-che/che-theia/blob/39511b763c67d02b388787a3b76939ac49241f45/devfile.yaml#L7-L10, the resulting workspace will fail to start because we have:

args:
 - 'sh'
 - '-c'
 - '${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}'

Screenshot/screencast of this PR

image

What issues does this PR fix or reference?

Explained in What does this PR do?

How to test this PR?

Sorry, I'm having some trouble with creating the dashboard image. I will add it here if I can get it working.

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Happy Path Channel

HAPPY_PATH_CHANNEL=stable

codecov[bot] commented 2 years ago

Codecov Report

Merging #1343 (69622af) into main (c299f59) will increase coverage by 3.96%. The diff coverage is 37.99%.

@@            Coverage Diff             @@
##             main    #1343      +/-   ##
==========================================
+ Coverage   32.78%   36.75%   +3.96%     
==========================================
  Files         290      330      +40     
  Lines        9885    11334    +1449     
  Branches     1457     1568     +111     
==========================================
+ Hits         3241     4166     +925     
- Misses       6641     7163     +522     
- Partials        3        5       +2     
Impacted Files Coverage Δ
...theia-about/src/browser/about-che-theia-dialog.tsx 0.00% <0.00%> (ø)
...credentials/src/browser/che-credentials-service.ts 0.00% <0.00%> (ø)
...entials/src/browser/credentials-frontend-module.ts 0.00% <0.00%> (ø)
...eia-credentials/src/common/credentials-protocol.ts 0.00% <0.00%> (ø)
...eia-credentials/src/node/che-credentials-server.ts 0.00% <0.00%> (ø)
...s/src/node/che-theia-credentials-backend-module.ts 0.00% <0.00%> (ø)
...ashboard/src/browser/che-theia-dashboard-module.ts 0.00% <0.00%> (ø)
...ia-dashboard/src/browser/theia-dashboard-client.ts 0.00% <0.00%> (ø)
...rowser/src/browser/che-mini-browser-environment.ts 0.00% <0.00%> (ø)
...in-ext/src/browser/che-sidecar-file-system-main.ts 100.00% <ø> (ø)
... and 294 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 39511b7...69622af. Read the comment docs.