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

RFE: support namespace as part of root bonfire command #217

Open
Victoremepunto opened this issue May 13, 2022 · 1 comment
Open

RFE: support namespace as part of root bonfire command #217

Victoremepunto opened this issue May 13, 2022 · 1 comment

Comments

@Victoremepunto
Copy link
Collaborator

I hope this makes sense!

I'm very used to provide a namespace to oc as part of the first options of every command, so if I have to issue multiple commands, I can repeat last command keeping the namespace variable part.

I cannot do this on bonfire because apparently namespace is part of specific commands or sub-commands like deploy or namespace extend and not a top level object.

While I understand oc is a general purpose tool for Openshift, specifically, I think it would improve the UX with Bonfire. However it's true I don't know if there are enough Bonfire operations specific to a namespace in particular for this to make sense, but ... if it does, here's an example of usage to illustrate what I mean:

This today doesn't work:

bonfire -n $EPHEMERAL_NAMESPACE deploy rbac
Usage: bonfire [OPTIONS] COMMAND [ARGS]...
Try 'bonfire -h' for help.

Error: no such option: -n

You should be doing this instead:

bonfire deploy -n $EPHEMERAL_NAMESPACE rbac

Now if I want to extend the duration of one of them I have to write it like this

bonfire namespace extend -d 1h $EPHEMEREAL_NAMESPACE

Whereas both commands could be like:

bonfire -n  $EPHEMEREAL_NAMESPACE deploy foobar
bonfire -n  $EPHEMEREAL_NAMESPACE namespace extend -d 1h
@bsquizz
Copy link
Collaborator

bsquizz commented May 18, 2022

This is also a quirk with the click CLI library I haven't spend time trying to solve yet: I'd like to be able to provide --debug at any point in the CLI but it only works if applied at the root level, e.g:

bonfire --debug deploy <args> works but bonfire deploy <args> --debug does not

I think it is possible to pass args between the command groups by sharing context but I also am not 100% sure how to do it best yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants