Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix extra lines in new-app output #13540

Merged
merged 1 commit into from
Mar 27, 2017
Merged

Conversation

gabemontero
Copy link
Contributor

Fixes #13492

Output now:

gmontero ~/go/src/github.com/openshift/origin  (13492)$ oc new-app --template=kube-system/heapster-standalone --dry-run
--> Deploying template "kube-system/heapster-standalone" for "kube-system/heapster-standalone" to project myproject

     Heapster Metrics (Standalone)
     ---------
     A simple metrics solution for an OpenShift cluster. Expects to be installed in the 'kube-system' namespace.

     * With parameters:
        * MASTER_URL=https://kubernetes.default.svc
        * IMAGE_PREFIX=openshift/origin-
        * IMAGE_VERSION=latest
        * METRIC_RESOLUTION=15s
        * STARTUP_TIMEOUT=500
        * NAMESPACE=kube-system

--> Creating resources ...
    serviceaccount "heapster" created (dry run)
    clusterrolebinding "heapster-cluster-reader" created (dry run)
    service "heapster" created (dry run)
    replicationcontroller "heapster" created (dry run)
--> Success (dry run)

@gabemontero
Copy link
Contributor Author

@openshift/devex @smarterclayton ptal

s := fmt.Sprintf("%s%s\n", tab, lval)
if len(strings.TrimSpace(s)) > 0 {
fmt.Fprintf(out, fmt.Sprintf("%s%s\n", tab, lval))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know that we care that much but this is going to strip out newlines in a string like "foo\n\nbar\n" (ie there's an intentional extra newline in the description and this will strip it).

might be better to just strip all trailing newlines from the string via a regex before doing the split.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me @bparees

Researching how the existing implementation got where it was, @juanvallejo added the formatString method in #12724 as part of addressing https://bugzilla.redhat.com/show_bug.cgi?id=1370104 for another look and feel complaint against output from the CLI.

Far as I can tell from the comments in those 2 items, there was no explicit intent to strip out newlines from things like "foo\n\nbar\n" ... does that sound right to you @juanvallejo ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabemontero

Far as I can tell from the comments in those 2 items, there was no explicit intent to strip out newlines from things like "foo\n\nbar\n" ... does that sound right to you @juanvallejo ?

Correct, I believe the original approach for formatString only focused on making sure that all new lines in a given string had the same level of indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @juanvallejo

@bparees - updated change ptal

@bparees bparees self-assigned this Mar 25, 2017
@bparees
Copy link
Contributor

bparees commented Mar 27, 2017

lgtm [merge]

@gabemontero
Copy link
Contributor Author

Hit flake #12007 and flake #12060 and flake kubernetes/kubernetes#38573

Those were the three failures during the conformance install run; everything else clean

@bparees please re-post merge comment at your convenience

@bparees
Copy link
Contributor

bparees commented Mar 27, 2017 via email

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 334cca2

@openshift-bot
Copy link
Contributor

openshift-bot commented Mar 27, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/208/) (Base Commit: 345cb97) (Image: devenv-rhel7_6104)

@openshift-bot openshift-bot merged commit 959be87 into openshift:master Mar 27, 2017
@gabemontero gabemontero deleted the 13492 branch March 27, 2017 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants