Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odo push deletes project files after making a change to devfile #2807

Closed
maysunfaisal opened this issue Apr 2, 2020 · 2 comments · Fixed by #2811
Closed

odo push deletes project files after making a change to devfile #2807

maysunfaisal opened this issue Apr 2, 2020 · 2 comments · Fixed by #2811
Assignees
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. kind/bug Categorizes issue or PR as related to a bug.

Comments

@maysunfaisal
Copy link
Contributor

maysunfaisal commented Apr 2, 2020

/kind bug

What versions of software are you using?

Operating System:

Output of odo version: master

How did you run odo exactly?

I noticed this when writing integration tests for devfile exec and confirmed this on the master branch without any of the exec code. Also seeing this with the integration test suite on the master branch.

  • odo set experimental true
  • odo push
  • change devfile like ENV for a container
  • odo push

Actual behavior

All the project files disappear from the container after the second push 😢

Expected behavior

Project files should be there! 😄

Any logs, error output, etc?

after first push
Maysuns-MacBook-Pro:T maysun$ oc exec -it spring-devfile-66ffc6549-skn2d bash -c tools
root@spring-devfile-66ffc6549-skn2d:/# cd /projects/springbootproject/
root@spring-devfile-66ffc6549-skn2d:/projects/springbootproject# ls -la
total 55372
drwxr-xr-x. 5 root root       231 Apr  2 22:40 .
drwxrwxrwx. 3 root root        31 Apr  2 22:40 ..
-rw-r--r--. 1  501 staff      213 Oct 21 19:00 .cw-settings
-rw-r--r--. 1  501 staff       74 Mar 13 16:23 .gitignore
drwxr-xr-x. 2 root root        25 Apr  2 22:40 .vscode
-rw-r--r--. 1  501 staff      237 Oct 21 19:00 Dockerfile
-rw-r--r--. 1  501 staff     2409 Oct 21 19:00 Dockerfile-build
-rw-r--r--. 1  501 staff      325 Oct 21 19:00 Dockerfile-tools
-rw-r--r--. 1  501 staff       97 Oct 21 19:00 Jenkinsfile
-rw-r--r--. 1  501 staff     1814 Oct 21 19:00 README.md
drwxr-xr-x. 3 root root        32 Apr  2 22:40 chart
-rw-r--r--. 1  501 staff     1770 Apr  2 22:34 devfile.yaml
-rwxr-xr-x. 1  501 staff 56662652 Mar 31 19:56 odo
-rw-r--r--. 1  501 staff     3011 Oct 21 19:00 pom.xml
drwxr-xr-x. 4 root root        30 Apr  2 22:40 src
after second push
Maysuns-MacBook-Pro:T maysun$ oc exec -it spring-devfile-57484d9b8f-8kq2x bash -c tools
root@spring-devfile-57484d9b8f-8kq2x:/# cd /projects/springbootproject/
root@spring-devfile-57484d9b8f-8kq2x:/projects/springbootproject# ls -la
total 4
drwxr-xr-x. 2 root root    26 Apr  2 22:43 .
drwxrwxrwx. 3 root root    31 Apr  2 22:43 ..
-rw-r--r--. 1  501 staff 1766 Apr  2 22:42 devfile.yaml

/area devfile

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. labels Apr 2, 2020
@johnmcollier
Copy link
Member

johnmcollier commented Apr 2, 2020

This is because we're using an emptyDir volume to store the project source and the pod that it's mounted to is going down (because of the env changes), thus taking down the emptyDir volume to.

Solution is to probably compare the resource versions of the component's pod before and after we attempt updates to it, if they're different it means the pod was recreated and we need to do a full sync. We could even just look at the pod name before and after to determine.

I'll take a look at this tomorrow

/assign

@johnmcollier
Copy link
Member

johnmcollier commented Apr 2, 2020

/assign @johnmcollier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants