odo: Erasing a local devfile is not enough to reset odo
/kind bug
What versions of software are you using?
Operating System: macOS 10.15.4
Output of odo version:
odo v1.2.0 (e1232ad1a)
Server: <redacted> Kubernetes: v1.11.0+d4cacc0
How did you run odo exactly?
- odo component create maven
- Realize that I actually wanted another component type
- odo component create java-spring-boot
- Get an error: ✗ This directory already contains a devfile.yaml, please delete it and run the component creation command again
- So follow the instructions and delete
devfile.yaml - odo component create java-spring-boot:
Experimental mode is enabled, use at your own risk
Validation
✓ Checking devfile compatibility [14ms]
✗ Validating devfile component [114030ns]
✗ This workspace directory already contains a devfile component
Actual behavior
See above.
Expected behavior
Be able to create my component the second time around without issue. At least, provide a better error message that would allow a user to fix the issue.
Any logs, error output, etc?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (16 by maintainers)
@kadel I am not sure if we should delete the devfile.yaml for the user as part of the
odo delete -acommand or should we require the user to manually delete the devfile.yaml. Consider the scenario that developer A has developed an app and check into git together with a customized devfile.yaml. Then, developer B clone that app git repo and use odo to continue to do the development. After developer B is done with the component, if developer B doodo delete -a, we’ll be removing the devfile.yaml that is not even created by odo. Should we consider the devfile.yaml as part of the application resource and let the user handle the lifecycle of that?Agreed with the second part,
odo delete --allshould definitely prompt for confirmation, the same as it is currently asking when runningodo delete. Only when--forceflag is provided the prompt should be skipped.Hmm, that also makes sense.
But what about this scenario:
odo createodo delete --allwith the assumption that it will delete everything that odo created after all the flag is called all (but in this case it will keep devfile.yaml)odo createagain and it fails 😦I think that if we are clear about what the
odo delete -adoes it should be ok, after all, it is not a default delete strategy users will need to provide additional flag, and they will be asked to confirm. If odo is creating devfile withodo createthere should be also a variation ofodo deletecommand to completely clean what odo created.What about this?
odo delete.odoanddevfile.yamlin place-fflagodo delete --allodo deletedoes.odoanddevfile.yaml-fflagThis would make
odo deleteis an inversion ofodo pushandodo delete --allinversion ofodo create; odo pushand the user will always have a choice to decide what to delete.What do you think?