Bug 1257889
Summary: | Wrong promotion message for oc attach regardless of parameter values | |||
---|---|---|---|---|
Product: | OKD | Reporter: | Yadan Pei <yapei> | |
Component: | oc | Assignee: | Fabiano Franz <ffranz> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Yan Du <yadu> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 3.x | CC: | aos-bugs, dmcphers, mmccomas, wsun | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1287414 (view as bug list) | Environment: | ||
Last Closed: | 2016-05-12 17:08:48 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1287414 |
Description
Yadan Pei
2015-08-28 10:29:38 UTC
The example in 'oc attach' was wrong. This command is not supposed to receive more than one argument (the pod name), since it's not supposed to run commands specified by the user like 'oc exec', but attach to the current process instead. The example was fixed in: https://github.com/openshift/origin/pull/5898 In case the user provides more than one argument, we must throw the error stating that it only takes one arg, and this validation happens before checking if the pod name is valid or not. Verified on devenv-rhel7_2712 oc v1.1-25-g0c0e452 kubernetes v1.1.0-origin-1107-g4c8e6f4 When there are more than one arguments carried, it gave error info. # oc attach doublecontainers date whoami error: expected a single argument: POD, saw 3: [doublecontainers date whoami] See 'oc attach -h' for help and examples. # oc attach doublecontainers -c hello-openshift date whoami error: expected a single argument: POD, saw 3: [doublecontainers date whoami] # oc attach -h Attach to a running container Attach the current shell to a remote container, returning output or setting up a full terminal session. Can be used to debug containers and invoke interactive commands. Usage: oc attach POD -c CONTAINER [options] Examples: # Get output from running pod 123456-7890, using the first container by default $ oc attach 123456-7890 # Get output from ruby-container from pod 123456-7890 $ oc attach 123456-7890 -c ruby-container # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-780 # and sends stdout/stderr from 'bash' back to the client $ oc attach 123456-7890 -c ruby-container -i -t Options: -c, --container='': Container name. If omitted, the first container in the pod will be chosen -i, --stdin=false: Pass stdin to the container -t, --tty=false: Stdin is a TTY Use "oc options" for a list of global command-line options (applies to all commands). (In reply to Fabiano Franz from comment #1) > The example in 'oc attach' was wrong. This command is not supposed to > receive more than one argument (the pod name), since it's not supposed to > run commands specified by the user like 'oc exec', but attach to the current > process instead. The example was fixed in: > > https://github.com/openshift/origin/pull/5898 > > In case the user provides more than one argument, we must throw the error > stating that it only takes one arg, and this validation happens before > checking if the pod name is valid or not. Just one thing to confirm, since 'oc attach' only attaches to process rather than running commands in container, how -i and-t will be used? When used with -i -t, the command will also attach stdin to the running process of the remote container. If the remote process is interactive, this will allow you to send keystrokes from stdin and interact with it. |