Skip to content

fix(serving): Update GVK on objects within a ResourcePrinter.#153

Closed
rhuss wants to merge 2 commits intoknative:masterfrom
rhuss:pr/printer-gvk
Closed

fix(serving): Update GVK on objects within a ResourcePrinter.#153
rhuss wants to merge 2 commits intoknative:masterfrom
rhuss:pr/printer-gvk

Conversation

@rhuss
Copy link
Copy Markdown
Contributor

@rhuss rhuss commented May 30, 2019

This is an alternate solution to #134 for fixing #133. In this commit
the update of the GVK coordinates are moved to the resource printer.

This is an alternate solution to knative#134 for fixing knative#133. In this commit
the update of the GVK coordinates are moved to the resource printer.
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label May 30, 2019
@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 30, 2019
@knative-prow-robot
Copy link
Copy Markdown
Contributor

Hi @rhuss. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /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.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 30, 2019
@rhuss
Copy link
Copy Markdown
Contributor Author

rhuss commented May 30, 2019

@cppforlife this is an alternative solution to #133 which moves the update of the GVK to the printer itself on every print. Tbh, I don't see much benefit over #134, one now has now instantiated a specialized ResourcePrinter around the printer obtained from cli-runtime, instead of updating the GVK before printing out the object. It has no less code and adds one layer more over the printer.

Also, you would need now create different printers based on which scheme (v1alpha1 or v1beta1) the objects are that you want to print, instead of reusing a generic printer usable for every object.

Group: "knative.dev",
Version: "v1alpha1",
Kind: "Revision"})
printer = printers.NewGvkUpdatePrinter(printer)
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.

In #134 you would call out to serving.UpdateGroupVersionKind() instead of wrapping the printer, which calls this method on print. Still, you have a specialized handling.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can we hide printers.NewGvkUpdatePrinter(printer) in revisionDescribePrintFlags.ToPrinter()?

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.

sure, let me align it with the service handling.

@rhuss
Copy link
Copy Markdown
Contributor Author

rhuss commented May 30, 2019

/assign cppforlife

@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

If they are not already assigned, you can assign the PR to them by writing /assign @cppforlife 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

@rhuss
Copy link
Copy Markdown
Contributor Author

rhuss commented Jun 3, 2019

Using #134, closing this one.

@rhuss rhuss closed this Jun 3, 2019
@rhuss rhuss deleted the pr/printer-gvk branch March 9, 2021 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Indicates the PR's author has signed the CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants