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.
Related PR: https://github.com/openshift/origin/pull/11664
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...")
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