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

Unable to pass oc rsh command flags after specifying a resource #10770

Closed
juanvallejo opened this issue Sep 1, 2016 · 2 comments
Closed

Unable to pass oc rsh command flags after specifying a resource #10770

juanvallejo opened this issue Sep 1, 2016 · 2 comments

Comments

@juanvallejo
Copy link
Contributor

Related BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1340554
Related Trello card: https://trello.com/c/04lpfTQR/451-8-cli-improved-flows-and-ux-in-the-cli-evg-ux-p3

oc rsh pod/<podname> --flag1 --flag2 does not consider --flag1 and --flag2 as actual flags, rather as arguments to be executed on 's top level container. The only way to get --flag1 to work is to pass it before pod/<podname>.

A solution to this could be to filter out args specified to the right of a resource that have the form ^-(-)?[a-zA-Z0-9]+(=.*)?, and have their value saved in RshOptions (or true if no =.*).

Version

oc v1.3.0-alpha.0+d0df369-dirty
kubernetes v1.3.0+507d3a7
features: Basic-Auth

Steps To Reproduce
  1. oc rsh pod idling-echo-1-sunqu --no-tty echo "hello world"
Current Result
  1. oc rsh pod idling-echo-1-sunqu --no-tty echo "hello world"
    • --no-tty flag is ignored, pseudo-terminal is still allocated
  2. oc rsh --no-tty pod idling-echo-1-sunqu echo "hello world"
    • flag works as expected, no pseudo-terminal is allocated, and command echo "hello world" still executes in the container.
Expected Result
  1. flag to the right of pod idling-echo-1-sunqu should be acknowledged, no pseudo-terminal should be allocated, command should run in container, and exit when done.
@liggitt
Copy link
Contributor

liggitt commented Sep 1, 2016

This is working as designed, to mimic rsh

@juanvallejo
Copy link
Contributor Author

@liggitt Okay, thanks for clarifying. I can go ahead and close the bugzilla.
Should there be a mention somewhere in the command's usage output that tells the user to place flags before the specified resource?

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