-
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
odo catalog list services -o json throws error when no services are available #4024
Comments
The behaviour we're seeing here is observed in more than just one place. For example: $ odo service list -o json
{
"kind": "Error",
"apiVersion": "odo.dev/v1alpha1",
"metadata": {
"creationTimestamp": null
},
"message": "Please specify the application name and project name\nOr use the command from inside a directory containing an odo component."
}
$ echo $?
1 The behaviour can be attributed to the use of Changing the behaviour for one command and not for another would be a tough and messy task, I guess. Besides, it would lead to inconsistency and hence bad UX, IMO. @jeffmaury under what circumstances would you, as a user, prefer exit code be 1 when executing |
The rules would be the following:
So I'm not complaining about the exit code but rather against the generated JSON output that should be one expected with an empty list |
this is expected because there is an error in the way the command was used @dharmit . but what @jeffmaury is mentioning is a valid bug. The idea with |
Now if the service catalog or operator hub is not enabled for the user then that should be an error because its something that we want the user to rectify. |
Yes but from a tooling experience, this error should not be returned as a process exit code as the tooling will have no way to interpret it unless the error code are property documented so it should returned as a documented JSON output |
/kind bug
What versions of software are you using?
Operating System:
Win10Pro
Output of
odo version
:How did you run odo exactly?
odo catalog list services -o json
Actual behavior
Exit code is non zero and payload is:
Expected behavior
Should execute normally and return a payload with an empty list of items
Any logs, error output, etc?
Run against OCP3 (CDK) with only service catalog installed
The text was updated successfully, but these errors were encountered: