Closed whitlockjc closed 7 years ago
Seems to be a problem with how cobra parses the flags. Because -o
is valid shorthand for --org
, supplying -org
parses out into -o rg
and fails as "You do not have admin permission for imageSpace rg"
.
Shall we just remove the shorthand?
To me that is a bug in Cobra but before we file something, we should go see if there is something already explaining this as "as designed". I would hate to lose shorthand for this.
Unfortunately, spf13/cobra
is operating within the POSIX spec for parsing command line arguments. This means that there is no chance to have this handled for us and my initial thought is that any attempt to work around this would be equally broken. Here is the GitHub issue I raised with spf13/cobra
to discuss the issue: https://github.com/spf13/cobra/issues/368
We've got report that if you do not specify the
--org
flag forshipyardctl create image
, you do not get an error and then a failure happens later in the request. This makes it harder to diagnose because you get an error like this: "You do not have admin permisison for imageSpace ..." Based on the customer usage, they were using-org
instead of--org
but no error ever happened.