Bug 1367824

Summary: Incomplete command output printed after running a container with oc run
Product: OpenShift Container Platform Reporter: Eric Rich <erich>
Component: NodeAssignee: Andy Goldstein <agoldste>
Status: CLOSED DUPLICATE QA Contact: DeShuai Ma <dma>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2.1CC: aos-bugs, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-18 18:35:09 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:

Description Eric Rich 2016-08-17 14:49:20 UTC
Description of problem:

After running: 

> oc run --generator=deploymentconfig/v1 --attach --stdin --tty --image registry.access.redhat.com/rhel7/rhel-tools rhel-tools bash

and exiting the container, I see: 

> Session ended, resume using ' rhel-tools-1-hkz0c -c rhel-tools -i -t' command when the pod is running

Version-Release number of selected component (if applicable):

oc version
oc v3.2.0.46-1-g3fab54d
kubernetes v1.2.0-36-g4a3f9c5

How reproducible: Frequent 

Steps to Reproduce:
1. oc run --generator=deploymentconfig/v1 --attach --stdin --tty --image registry.access.redhat.com/rhel7/rhel-tools rhel-tools bash
2. exit container (ctrl+c)

Actual results:

Session ended, resume using ' rhel-tools-1-hkz0c -c rhel-tools -i -t' command when the pod is running

Expected results:

The command should say: 

Session ended, resume using 'oc attach rhel-tools-1-hkz0c -c rhel-tools -i -t' command when the pod is running

Additional info:

After running: 

> oc attach rhel-tools-1-hkz0c -c rhel-tools -i -t

and exiting the container, I see that the output says: 

> Session ended, resume using 'kubectl attach rhel-tools-1-hkz0c -c rhel-tools -i -t' command when the pod is running

This too is wrong as the command its pulling is kubectl and not oc (even though they are synonymous). 

Error: https://github.com/openshift/origin/blob/master/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/attach.go#L242

Comment 1 Xingxing Xia 2016-08-18 05:06:10 UTC
Tried above commands "oc run" and "oc attach" both with oc v3.2.0.46 and oc v3.3.0.22. Fixed in v3.3.0.22, reproduced in v3.2.0.46. In fact, there was one: https://bugzilla.redhat.com/show_bug.cgi?id=1341450

Comment 2 Andy Goldstein 2016-08-18 18:35:09 UTC
This is a dupe of 1341450. It was fixed in 3.3.

*** This bug has been marked as a duplicate of bug 1341450 ***