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

kubectl: 'apply view-last-applied' must not use printf() semantics #45611

Merged
merged 1 commit into from
Jun 28, 2017

Conversation

atombender
Copy link
Contributor

@atombender atombender commented May 10, 2017

What this PR does / why we need it:
This fixes kubectl apply view-last-applied to not use fmt.Fprintf(), as this will cause format codes in the YAML/JSON to be interpreted. For example, if a resource manifest contains %r, this would cause view-last-applied so print %!r(MISSING).

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #45608.

Special notes for your reviewer:

Release note:

Fixes an edge case where "kubectl apply view-last-applied" would emit garbage if the data contained Go format codes.

…l cause format codes in the YAML/JSON to be interpreted.
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 10, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

Hi @atombender. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 10, 2017
@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels May 10, 2017
@atombender
Copy link
Contributor Author

(Still waiting for the CNCF account service to send me a CLA to sign.)

@emsearcy
Copy link

Bump for CLA re-check

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 23, 2017
@mengqiy
Copy link
Member

mengqiy commented Jun 14, 2017

/assign

@mengqiy
Copy link
Member

mengqiy commented Jun 14, 2017

@k8s-bot ok to test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 14, 2017
@mengqiy
Copy link
Member

mengqiy commented Jun 14, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 14, 2017
@k8s-github-robot k8s-github-robot added the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jun 14, 2017
@atombender
Copy link
Contributor Author

Updated release note.

@k8s-github-robot k8s-github-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels Jun 14, 2017
@shiywang
Copy link
Contributor

/lgtm

@shiywang
Copy link
Contributor

@k8s-bot pull-kubernetes-unit test this

@atombender
Copy link
Contributor Author

Is this because the PR branched from a failing commit? Should I rebase?

@mengqiy
Copy link
Member

mengqiy commented Jun 26, 2017

/retest

@mengqiy
Copy link
Member

mengqiy commented Jun 26, 2017

@pwittrock @fabianofranz Can you approve this and remove do-not-merge label?

@mengqiy
Copy link
Member

mengqiy commented Jun 27, 2017

/retest

@fabianofranz fabianofranz removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Jun 28, 2017
@fabianofranz
Copy link
Contributor

/lgtm
/approve

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: atombender, fabianofranz, mengqiy, shiywang

Associated issue: 45608

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 28, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 48183, 45611, 48065)

@k8s-github-robot k8s-github-robot merged commit 7c656ab into kubernetes:master Jun 28, 2017
openshift-merge-robot added a commit to openshift/origin that referenced this pull request Oct 21, 2017
…45611

Automatic merge from submit-queue.

UPSTREAM: 45611: remove use of printf semantics for view-last-applied cmd

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1503601

Picks changes introduced in upstream PR kubernetes/kubernetes#45611 which removes printf() semantics from the output of `apply view-last-applied`. Using printf() was causing values with `%` to be interpreted as Go format code, which in turn adding unwanted statements such as `(MISSING)!` to the yaml / json output of the command.

cc @openshift/cli-review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"apply view-last-applied" munges format codes in YAML/JSON
9 participants