-
Notifications
You must be signed in to change notification settings - Fork 243
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
Specifying a name does not matter when using odo delete #3892
Comments
This one's gonna be a little messy to fix 😕 - looking over the delete code, there's lots of assumptions that we have access to both the devfile and envinfo file when deleting a component |
@johnmcollier whats wrong with that? if devfile context is always defined by the current dir or
|
@maysunfaisal It's moreso that if we want to be able to delete a devfile component by name, we need to be able to delete it without being in / pointing to that component's context folder. E.g. |
But
|
It may not make much sense without support for |
@johnmcollier ok i see your point. Yeah you needed the |
@maysunfaisal That's a good question. Since we don't need to point to the context / component folder for |
Are we going to have problems on supporting |
@elsony I went and checked to see what
However, the config files were not deleted so it really just silently failed. I think if there isn't a way to get |
I have the same concern as @maysunfaisal to make For the Is the only reason why we wanted to make it to work is to get a consistent behaviour as the s2i scenario? We have got other cases where the command parameters, etc. are different between devfile and s2i support. Given that devfile support is our future, I'd rather make it clear on the command help/behaviour on what work on s2i vs devfile than introducing inconsistent behaviour within the devfile support. |
So I have two reasons for wanting to be able to delete a component by name, and not relying solely on the component folder:
There's already some commands that don't require the component folder to work, such as
|
#1 I don't think multiple app/component makes a difference. A single component has the same problem as the multiple case. ok, I can see user case for #2 where I lost my original folder and wanted to delete the component. I am fine to support that for devfile type components. However, the described scenario is restricted to |
Sorry, for #1 let me clarify - I meant scenarios where we may have multiple components on your machine (and even more if there's multiple components in multiple apps), and each component has its own folder. So being able to delete the component without having to find the component folder would save time / avoid a nuisance for the user. But I agree, the better use case is actually #2 where the folder is lost or not accessible. I'm surprised actually that |
**What type of PR is this?** > Uncomment only one ` /kind` line, and delete the rest. > For example, `> /kind bug` would simply become: `/kind bug` /kind bug **What does does this PR do / why we need it**: This is a temporary fix by removing the current feature of being able to pass in a component name to `odo delete`. For example. `odo delete foobar` does not work. We remove that functionality so you may only specify `odo delete` in the current directory. **Which issue(s) this PR fixes**: Does not fix any issues, but please see: redhat-developer#3892 **PR acceptance criteria**: - [X] Unit test - [X] Integration test - [X] Documentation - [X] I have read the [test guidelines](https://github.com/openshift/odo/blob/master/docs/dev/test-architecture.adoc) **How to test changes / Special notes to the reviewer**: ```sh odo create nodejs --starter odo push odo delete ``` Signed-off-by: Charlie Drage <charlie@charliedrage.com>
So need some insight on this... When deploying a nodejs example (via
The issue is running these two commands OUTSIDE of the directory.
My thoughts:
One problem: What if there are multiple components of the same name in two different app's? My solution:
What do you guys think @johnmcollier @elsony |
sounds good
Along the line of your multiple hit with same name question, I think we should iterate through all of them to make sure there is one and only one match before we execute the deletion. When multiple components with the same name under different apps are found, we need to either prompt them to choose or give them the list of matched components with the app name and ask them to specify |
Sounds good! Glad we're on the same page. I'll start on the implementation. |
Worked the past two days on this implementation and unfortunately there's an another issue I face. Specifically, it's Specifically: preStopEvents := a.Devfile.Data.GetEvents().PreStop
if len(preStopEvents) > 0 {
if pod.Status.Phase != corev1.PodRunning {
return fmt.Errorf("unable to execute preStop events, pod for component %s is not running", a.ComponentName)
}
err = a.ExecDevfileEvent(preStopEvents, common.PreStop, show)
if err != nil {
return err
}
} So when using Should we just warn / skip PreStop? @johnmcollier @elsony |
Ok I have kind of got the gist of what @cdrage was trying to do. I have now pulled pr into my own branch and will push it as a WIP shortly |
How is this coming along? |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closing this issue. 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. |
/kind bug
What versions of software are you using?
Operating System: Linux
Output of
odo version
: master 👍How did you run odo exactly?
Actual behavior
It does not matter what you specify to
odo delete
it will delete whatever is in your current folder...Expected behavior
To fail when passing in something random such as
odo delete alksjdalksjdklasd -f
Any logs, error output, etc?
See above
The text was updated successfully, but these errors were encountered: