Bug 1274149 - oc attach could not attach to a running container
Summary: oc attach could not attach to a running container
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-22 06:01 UTC by Yadan Pei
Modified: 2016-05-25 13:31 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-23 14:24:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yadan Pei 2015-10-22 06:01:35 UTC
Description of problem:
Run oc attach to a running pod gives error instead of attaching to it

Version-Release number of selected component (if applicable):
oc v1.0.6-835-g4c014f5
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4

How reproducible:
Always

Steps to Reproduce:
1.Create a pod and wait to be Running
$ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/pods/pod_with_two_containers.json
$ oc get pods
NAME               READY     STATUS    RESTARTS   AGE
doublecontainers   2/2       Running   0          2h
2.oc attach doublecontainers


Actual results:
error: unable to upgrade connection: you must specify at least 1 of stdin, stdout, stderr

Expected results:
Should get output from running pod doublecontainers

Additional info:

Comment 2 Jordan Liggitt 2015-10-22 14:53:06 UTC
Likely the same issue as https://github.com/smarterclayton/kubernetes/commit/7f6f85bd7b47db239868bcd868ae3472373a4f05 fixed in https://github.com/kubernetes/kubernetes/pull/15053

Might need to cherry pick that

Comment 3 Jordan Liggitt 2015-10-22 17:16:59 UTC
should be fixed in https://github.com/openshift/origin/pull/4819

Comment 4 Yadan Pei 2015-10-27 02:26:39 UTC
Verified on 
oc v3.0.2.903-29-g49953d6
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4

$ oc attach doublecontainers -c hello-openshift-fedora
serving on 8081
serving on 8888

$ oc attach doublecontainers
Started, serving at 8080

$ oc attach doublecontainers -c hello-openshift
Started, serving at 8080

it could attach to a running container

Comment 5 Brenton Leanhardt 2015-11-23 14:24:27 UTC
This fix is available in OpenShift Enterprise 3.1.


Note You need to log in before you can comment on or make changes to this bug.