-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Escape ‘%’ in console.OutStyle arguments #4026
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 11janci If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Can one of the admins verify this patch? |
bcc4d4c
to
3ade5d5
Compare
/assign @dlorenc |
There was a problem hiding this comment.
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 ?
Agreed. This will definitely need an addition to console_test.go. |
@minikube-bot OK to test |
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) |
There was a problem hiding this comment.
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 "%"
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
3ade5d5
to
a6ec2ad
Compare
a6ec2ad
to
160dc85
Compare
@tstromberg @afbjorklund done, thanks for pointing to the test, now I found it was also broken for ErrStyle()... /ptal |
/retest |
@11janci: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
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