Bug 1390140 - dry run with output format will print extra line which broke the format
Summary: dry run with output format will print extra line which broke the format
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-31 09:56 UTC by XiaochuanWang
Modified: 2017-03-08 18:43 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Extra line of information caused invalid json/yaml output in `oc set` Consequence: json/yaml output was no longer machine parsable Fix: Extra line of information is now output through stderr Result: Valid json/yaml is now printed through `oc set`
Clone Of:
Environment:
Last Closed: 2017-01-18 12:47:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 17:23:26 UTC

Description XiaochuanWang 2016-10-31 09:56:01 UTC
Description of problem:
Create resource with container(s), dry run to set container a new image and try to output in yaml or json format at the same command.

Version-Release number of selected component (if applicable):
oc v3.4.0.17+b8a03bc

How reproducible:
Always

Steps to Reproduce:
1.# oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/deployment/dc-with-two-containers.yaml
2.# oc tag docker.io/openshift/hello-openshift xiaocwan-r/ho:latest
3.# oc get dc -o yaml > dc.yaml
# oc set image -f ./dc.yaml dctest-2=xiaocwan-r/ho:latest   --local -o yaml > dc.yaml
Check the dc.yaml


Actual results:
First line in output is "running in local mode..." which broke the yaml format, will not work when user use dc.yaml directly 

Expected results:
Output should be in yaml format

Additional info:
Output in json will also have the same line.
oc convert --local don't have the problem.

Comment 1 Juan Vallejo 2016-11-01 22:49:52 UTC
Related PR: https://github.com/openshift/origin/pull/11664

Comment 2 XiaochuanWang 2016-11-03 03:35:15 UTC
Verified on oc v3.4.0.19 with original steps:
1.# oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/deployment/dc-with-two-containers.yaml
2.# oc tag docker.io/openshift/hello-openshift xiaocwan-r/ho:latest
3.# oc get dc -o yaml > dc.yaml 
=> update dc.yaml to use xiaocwan-r/ho:latest for the 2nd image
4. # oc set image -f ./dc.yaml dctest-2=xiaocwan-r/ho:latest   --local -o yaml 
running in local mode...
apiVersion: v1
kind: DeploymentConfig
metadata:
  creationTimestamp: 2016-11-03T02:53:08Z
  ...
5. # oc set image -f ./dc.yaml dctest-2=xiaocwan-r/ho:latest   --local -o yaml > out.yaml
running in local mode...
#cat out.yaml =>(it's a pure yaml format file without line "running in local mode...")

Comment 4 errata-xmlrpc 2017-01-18 12:47:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0066


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