-
Notifications
You must be signed in to change notification settings - Fork 244
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
Implement odo delete component --files
to delete files generated by odo
#6255
Implement odo delete component --files
to delete files generated by odo
#6255
Conversation
✅ Deploy Preview for odo-docusaurus-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
4feb896
to
05317f4
Compare
05317f4
to
f28ac06
Compare
odo delete component --files
odo delete component --files
to delete files generated by odo
The end goal is for 'odo delete component --files' to gather a list of files that were initially generated by odo, so as to delete only those. This way, we are less likely to delete the wrong files. This list is collected in a '.odo/generated' file. It will then be up to odo commands to call those methods accordingly. For example, this is called: - by odo init, odo dev, or odo deploy, when generating a new devfile.yaml - by odo dev, when there is no .gitignore file and odo generated one Note that it is quite impossible to cover all scenarios; for example, if odo generates a new devfile.yaml file, but the user deletes it manually and recreates it, 'odo delete component --files' will still list it as a possible candidate for deletion (because it would be listed in .odo/generated).
Co-authored-by: Philippe Martin <[email protected]>
It is more likely to be modified by the user afterward (for another usage). Co-authored-by: Philippe Martin <[email protected]>
0bb8f31
to
032e83c
Compare
Rebased and force-pushed to fix the conflicts reported. |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code lgtm. I am not very sure about the integration tests yet, but everything else is functional.
Kudos, SonarCloud Quality Gate passed!
|
/test v4.11-integration-e2e |
/override ci/prow/v4.11-integration-e2e /lgtm |
@valaparthvi: Overrode contexts on behalf of valaparthvi: ci/prow/v4.11-integration-e2e In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this:
/area component
What does this PR do / why we need it:
See #5997 for the user story.
In a nutshell, this PR adds a new
--files
flag toodo delete component
, the goal of which is to delete files that were created byodo
.To avoid deleting files we should not, it does so by introducing utility functions at the CLI level, so that commands can report which files they created. The list of files created is then stored in in a dedicated
.odo/generated
file. This way, we will be able to know which files were initially created by odo and which ones were not.The reason for this is that files like
devfile.yaml
might or might not be created byodo
. Also,odo dev
for example creates a.gitignore
file if it does not exist. So in some cases, we need to delete those files, and in other cases, we should not touch them.See
c47307b
(#6255) and350b9ac
(#6255)In all cases, we list all the files that are candidates for deletion and ask the user for confirmation (unless the
--force
flag is used).Which issue(s) this PR fixes:
Fixes #5997
PR acceptance criteria:
Unit test
Integration test
Documentation:
How to test changes / Special notes to the reviewer:
—