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 storage create" with "--app" and "--project" flags is broken #2203

Closed
dharmit opened this issue Sep 30, 2019 · 5 comments · Fixed by #2238
Closed

"odo storage create" with "--app" and "--project" flags is broken #2203

dharmit opened this issue Sep 30, 2019 · 5 comments · Fixed by #2238
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).

Comments

@dharmit
Copy link
Member

dharmit commented Sep 30, 2019

[kind/bug]

What versions of software are you using?

  • Operating System: all
  • Output of odo version: master

How did you run odo exactly?

Created storage with --app and --project flags where the values of these flags were different from the values in component directory. Also, these values were invalid because the app and project with those names don't exist.

$ odo config view
COMPONENT SETTINGS
------------------------------------------------
PARAMETER         CURRENT_VALUE
Type              nodejs
Application       app
Project           myproject
SourceType        local
Ref               
SourceLocation    ./
Ports             8080/TCP
Name              nodejs-nodejs-ex-vaiv
MinMemory         
MaxMemory         
DebugPort         
Ignore            
MinCPU            
MaxCPU

# we now create storage that doesn't belong to the app/project in above config
$ odo storage create invalidstorage \
> --path=/opt/newstorage \
> --size=1Gi \
> --app newapp \
> --project newproject
 ✓  Added storage invalidstorage to nodejs-nodejs-ex-vaiv
Please use `odo push` command to make the storage accessible to the component

$ odo push # works just fine.

$ odo storage list
The component 'nodejs-nodejs-ex-vaiv' has the following storage attached:
NAME               SIZE     PATH
invalidstorage     1Gi      /opt/newstorage

# inside the remote pod
sh-4.2$ ls /opt
app-root  newstorage  odo  rh

Actual behavior

  1. odo storage create command reports no error
  2. odo push creates a storage for the component

Expected behavior

odo storage create should report some error indicating that the app/project are invalid. Creating the app/project upon odo push after odo storage create doesn't make sense because a storage is created for a component.

@dharmit
Copy link
Member Author

dharmit commented Sep 30, 2019

IMO, odo storage create is closely tied with the component. We could even remove the --app and --project flags from it so that it can be created from a component directory or with a --context flag.

@kadel unless I'm mistaken, odo storage create with these extra flags looks miserably broken to me. (hoping to be wrong.)

@kadel
Copy link
Member

kadel commented Sep 30, 2019

You are right. The --app, --project and also --component doesn't make much sense.
Original idea was that you could create storage and then attach it to multiple components. But with context directory and LocalComponet this is easily possible.

It would be a good idea to remove those flags, and just leave the --context.
I suspect that url create is in the same situation.

@kadel
Copy link
Member

kadel commented Sep 30, 2019

/kind bug
/priority high

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 30, 2019
@openshift-ci-robot
Copy link
Collaborator

@kadel: The label(s) kind/ cannot be applied. These labels are supported: platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga

In response to this:

/kind bug
/priority high

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.

@openshift-ci-robot openshift-ci-robot added the priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). label Sep 30, 2019
@dharmit
Copy link
Member Author

dharmit commented Sep 30, 2019

@kadel You're right about the odo url create remark.

$ odo url create myurl --app nosuchapp --project nosuchproject
 ✓  URL myurl created for component: nodejs-nodejs-ex-vaiv

To create URL on the OpenShift Cluster, please use `odo push`

$ odo url list
Found the following URLs for component nodejs-nodejs-ex-vaiv in application app:
NAME      STATE          URL     PORT
myurl     Not Pushed     ://     8080

There are local changes. Please run 'odo push'.
$ odo push 
# push was successful and url got created for the component in pwd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants