Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1390140 - dry run with output format will print extra line which broke the format
dry run with output format will print extra line which broke the format
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.4.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Juan Vallejo
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-31 05:56 EDT by XiaochuanWang
Modified: 2017-03-08 13 EST (History)
4 users (show)

See Also:
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`
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-18 07:47:53 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 12:23:26 EST

  None (edit)
Description XiaochuanWang 2016-10-31 05:56:01 EDT
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 18:49:52 EDT
Related PR: https://github.com/openshift/origin/pull/11664
Comment 2 XiaochuanWang 2016-11-02 23:35:15 EDT
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 07:47:53 EST
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.