8000 Escape ‘%’ in console.OutStyle arguments by 11janci · Pull Request #4026 · kubernetes/minikube · GitHub
[go: up one dir, main page]

Skip to content

Escape ‘%’ in console.OutStyle arguments 8000 - #4026

Merged
tstromberg merged 1 commit into
kubernetes:masterfrom
11janci:jjanik-console-escaping
Apr 11, 2019
Merged

tstromberg merged 1 commit into
kubernetes:masterfrom
11janci:jjanik-console-escaping

Conversation

@11janci
@11janci 11janci commented Mar 31, 2019 •
Copy link
Copy Markdown
Contributor

Escape arguments to console.OutStyle so that '%' signs get printed out instead of being interpreted as formatting directives and printed out like %!e(MISSING)
Closes #4025

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 31, 2019
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 11janci
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: dlorenc

If they are not already assigned, you can assign the PR to them by writing /assign @dlorenc in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 31, 2019
@minikube-bot
Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@11janci
11janci force-pushed the jjanik-console-escaping branch from bcc4d4c to 3ade5d5 Compare March 31, 2019 02:54
@11janci
11janci commented Mar 31, 2019
Copy link
Copy Markdown
Contributor Author

/assign @dlorenc

@afbjorklund afbjorklund left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, does it need a test perhaps ?

@tstromberg
Copy link
Copy Markdown
Contributor

Agreed. This will definitely need an addition to console_test.go.

@tstromberg
Copy link
Copy Markdown
Contributor

@minikube-bot OK to test

8000

Comment thread pkg/minikube/console/console.go Outdated
outStyled, err := applyStyle(style, useColor, format, a...)
// format the output string and escape any outstanding '%' signs so that they don't
// get interpreted as a formatting directive down the line
outStyled = strings.Replace(outStyled, "%", "%%", -1)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should probably use % instead of "%"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this is just a github thing, neither IDE nor gofmt complains

@tstromberg tstromberg left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR! I'll approve once it has a test to verify that we don't break this again in the future.

@11janci
11janci force-pushed the jjanik-console-escaping branch from 3ade5d5 to a6ec2ad Compare April 5, 2019 04:13
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 5, 2019
@11janci
11janci force-pushed the jjanik-console-escaping branch from a6ec2ad to 160dc85 Compare April 5, 2019 04:27
@11janci
11janci commented Apr 5, 2019 •
Copy link
Copy Markdown
Contributor Author

@tstromberg @afbjorklund done, thanks for pointing to the test, now I found it was also broken for ErrStyle()...

/ptal

@11janci
11janci commented Apr 7, 2019
Copy link
Copy Markdown
Contributor Author

/retest

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@11janci: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tstromberg
tstromberg merged commit e316a4d into kubernetes:master Apr 11, 2019
@11janci
11janci deleted the jjanik-console-escaping branch July 14, 2020 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

0