Bug 1370104 - oc get/describe/new-app not display/indent well when template description contains newlines
Summary: oc get/describe/new-app not display/indent well when template description con...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-25 10:36 UTC by Xingxing Xia
Modified: 2017-07-24 14:11 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Multi-line output for a template description did not display all lines with correct indentation under `oc new-app` Consequence: Output for template descriptions was hard to read Fix: Added a new helper function `formatString` that indents all lines for a multi-line template description. Result: Template description for `oc new-app <my_template>` is easier to read.
Clone Of:
Environment:
Last Closed: 2017-04-12 19:06:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0884 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.5 RPM Release Advisory 2017-04-12 22:50:07 UTC

Description Xingxing Xia 2016-08-25 10:36:12 UTC
Description of problem:
oc get/describe/new-app not display newlines well when template description contains newlines.

Version-Release number of selected component (if applicable):
oc v3.3.0.25+d2ac65e-dirty
kubernetes v1.3.0+507d3a7
features: Basic-Auth GSSAPI Kerberos SPNEGO

How reproducible:
Always

Steps to Reproduce:
1. Create a template which contains newline(s) in description
$ oc create -f https://raw.githubusercontent.com/openshift/origin/b1983988/examples/jenkins/jenkins-ephemeral-template.json

Download the file, will see it has newline in description:
$ cat jenkins-ephemeral-template.json
    "annotations": {
      "description": "Jenkins service, without persistent storage.\nWARNING: Any data stored will be lost upon pod destruction ...

2.
$ oc get template jenkins-ephemeral
NAME                                  DESCRIPTION   PARAMETERS   OBJECTS
jenkins-ephemeral                     Jenkins service, without persistent storage.
WARNING: Any data stored will be...   6 (1 generated)   6

3.
$ oc describe template jenkins-ephemeral
Name:		jenkins-ephemeral
Namespace:	xxia-proj
Created:	27 seconds ago
Labels:		<none>
Description:	Jenkins service, without persistent storage.
WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing
...

4.
$ oc new-app jenkins-ephemeral
--> Deploying template "jenkins-ephemeral" in project "openshift"

     jenkins-ephemeral
     ---------
     Jenkins service, without persistent storage.
WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing ...

     A Jenkins service has been created in your project.  The username/password are admin/0Sbiw6SF45Paksnv.  The tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.

     * With parameters:
        * Jenkins Service Name=jenkins
        ...

Comment 1 XiaochuanWang 2016-11-15 05:59:05 UTC
Tested on OCP oc v3.4.0.26:

Step 2 'oc get template jenkins-ephemeral' is fixed and merged in PR: https://github.com/openshift/ose/pull/462/commits/8df9d32cacc37c7e52c88ab3cf85f07f56a32cdc

Step 3 and Step 4 is still reproduced, waiting for fix.

Comment 2 Juan Vallejo 2017-01-30 23:29:27 UTC
Related PR: https://github.com/openshift/origin/pull/12724

Comment 3 Xingxing Xia 2017-02-17 01:43:04 UTC
Verified in v3.5.0.26. Based on comment 0 steps, now step 3 shows:
$ oc describe template jenkins-ephemeral
...
Description:	Jenkins service, without persistent storage.
		WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing
...

Step 4 shows:
$ oc new-app jenkins-ephemeral
...
     jenkins-ephemeral
     ---------
     Jenkins service, without persistent storage.
     WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing
...

So oc get/describe/new-app now display newlines well when template description contains newlines.

Comment 5 errata-xmlrpc 2017-04-12 19:06:32 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:0884


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