odo: odo component delete doesn't actually delete the component

[kind/bug]

What versions of software are you using?

  • Operating System: macOS
  • Output of odo version: v1.0.0-beta1

How did you run odo exactly?

odo create nodejs backend
odo push
odo url create backend --port 8080
odo push
odo component delete backend (y, to delete URL)

See output below.

Actual behavior

As you can see from the output below, running odo component delete backend says it’s deleted, but the config is still there and I cannot create a new component in that directory.

$  odo component get
The current component is: backend
 $  cat .odo/config.yaml
kind: LocalConfig
apiversion: odo.openshift.io/v1alpha1
ComponentSettings:
  Type: nodejs
  SourceLocation: ./
  SourceType: local
  Application: app
  Project: odo-workshop-h6djc
  Name: backend
  Url:
  - Name: backend
    Port: 8080
 $ odo component delete backend
This component has following urls that will be deleted with component
URL named backend with host backend-app-odo-workshop-h6djc.apps.jkleinert-e293.openshiftworkshop.com h
aving protocol http at port 8080
? Are you sure you want to delete backend from app? Yes
 ✓  Deleting component backend
 ✓  Component backend from application app has been deleted
$ odo component get
The current component is: backend
 $ cat .odo/config.yaml
kind: LocalConfig
apiversion: odo.openshift.io/v1alpha1
ComponentSettings:
  Type: nodejs
  SourceLocation: ./
  SourceType: local
  Application: app
  Project: odo-workshop-h6djc
  Name: backend
  Url:
  - Name: backend
    Port: 8080
  $  odo create nodejs backend2
 ✗  this directory already contains a component

Expected behavior

I expected odo component delete to remove the component configuration. I cannot find a way to do that, meaning I’d have to delete .odo/config.yaml if I want to get rid of my component and create a new one.

Any logs, error output, etc?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

I think that when running delete, one should ask the user, Hey, you're deleting the odo config for this component but it's deployed. Do you want to remove it from the cluster?

But, most of the times they will only want to remove the application from the cluster, as the configuration will most likely want to go into the Git repo.