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

ensure PrinterForCommand is consumed through cmdutil.Factory #54881

Conversation

juanvallejo
Copy link
Contributor

Release note:

NONE

This patch is one in a series of patches that aims to move all
printing functions to the cmdutil.Factory in order to make
the factory the one-stop shop for accessing printers in the client.

This PR is related to #50113 and aims to break the set of changes
introduced in this commit in order to make them easier to review.

@fabianofranz @mengqiy @shiywang

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 31, 2017
@dims
Copy link
Member

dims commented Nov 1, 2017

/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 Nov 1, 2017
@juanvallejo juanvallejo force-pushed the jvallejo/use-printer-for-cmd-through-factory branch 3 times, most recently from fe55b6a to 6f2ce18 Compare November 2, 2017 16:00
@juanvallejo
Copy link
Contributor Author

/retest

@juanvallejo
Copy link
Contributor Author

/test pull-kubernetes-unit
/test pull-kubernetes-bazel-test

@juanvallejo
Copy link
Contributor Author

/retest

@juanvallejo juanvallejo force-pushed the jvallejo/use-printer-for-cmd-through-factory branch from 6f2ce18 to 784b2a1 Compare November 9, 2017 20:16
@juanvallejo
Copy link
Contributor Author

/retest

@juanvallejo juanvallejo force-pushed the jvallejo/use-printer-for-cmd-through-factory branch from 784b2a1 to 7cb7417 Compare November 14, 2017 18:48
@dims
Copy link
Member

dims commented Nov 15, 2017

@kubernetes/sig-cli-maintainers

/unassign

@juanvallejo
Copy link
Contributor Author

ping @fabianofranz @mengqiy

@@ -131,7 +131,7 @@ func PrinterForCommand(cmd *cobra.Command, outputOpts *printers.OutputOptions, m
// we try to convert to HumanReadablePrinter, if return ok, it must be no generic
// we execute AddHandlers() here before maybeWrapSortingPrinter so that we don't
// need to convert to delegatePrinter again then invoke AddHandlers()
if humanReadablePrinter, ok := printer.(*printers.HumanReadablePrinter); ok {
if humanReadablePrinter, ok := printer.(printers.PrintHandler); ok {
Copy link
Member

Choose a reason for hiding this comment

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

entangling adding handlers and wrapping in this single function doesn't allow adding additional handlers in a calling factory. @smarterclayton, thoughts on the sorting wrapper being added this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@liggitt will leave this line as-is for now. There is a proposal for discussing how to address adding handlers to a printer, however a goal would be to eliminate printer handlers altogether in favor of server-side printers.

ping @smarterclayton

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 21, 2017
@juanvallejo juanvallejo force-pushed the jvallejo/use-printer-for-cmd-through-factory branch from 7cb7417 to 8c9c2ee Compare December 5, 2017 18:40
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 5, 2017
@juanvallejo
Copy link
Contributor Author

juanvallejo commented Dec 6, 2017

@mfojtik or @fabianofranz wondering if you could take a look? last PR left on https://trello.com/c/7wjtBnNu

@fabianofranz
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 12, 2017
@kubernetes kubernetes deleted a comment from k8s-github-robot Dec 12, 2017
@fabianofranz
Copy link
Contributor

/approve no-issue

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabianofranz, juanvallejo

Associated issue requirement bypassed by: fabianofranz

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-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 12, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 56676, 57050, 54881, 56822, 57113). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 6236cdd into kubernetes:master Dec 17, 2017
@juanvallejo juanvallejo deleted the jvallejo/use-printer-for-cmd-through-factory branch December 18, 2017 22:10
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-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants