Fix issue #205 to add route describe feature and test#228
Fix issue #205 to add route describe feature and test#228zhangtbj wants to merge 0 commit intoknative:masterfrom zhangtbj:master
Conversation
|
Hi @zhangtbj. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/assign @maximilie |
|
@zhangtbj: GitHub didn't allow me to assign the following users: maximilie. Note that only knative members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time. DetailsIn 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. |
|
/ok-to-test |
|
The following is the coverage report on pkg/.
|
| } | ||
|
|
||
| t.Run("requires the route name", func(t *testing.T) { | ||
| _, _, err := fakeRouteDescribe([]string{"route", "describe"}, &v1alpha1.Route{}) |
There was a problem hiding this comment.
Why is setup(t) not called here? Perhaps do it for consistency
There was a problem hiding this comment.
Hi Max, because this test is only for wihtout route name test. So doesn't need to initialize any fake route in setup. So I skip it. If we hope to be consistent. I can add it back. Thanks!
| assert.Assert(t, err == nil) | ||
| assert.Assert(t, action != nil) | ||
| assert.Assert(t, action.Matches("get", "routes")) | ||
|
|
There was a problem hiding this comment.
Not sure I see the value of JSON conversion here. Why not just parse the YAML returned (it’s the default output)
There was a problem hiding this comment.
Yes, in this test, I parse to json format and Unmarshal it to a route object returnedRoute. Then compare it with expectedRoute
|
Nice job @zhangtbj left a few minor comments. Adding @navidshaikh as reviewer too. |
|
/assign @navidshaikh |
|
@maximilien: GitHub didn't allow me to assign the following users: navidshaikh. Note that only knative members and repo collaborators can be assigned and that issues/PRs can only have 10 assignees at the same time. DetailsIn 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. |
|
@zhangtbj coudl you please rebase on master ? Gotest.tools is already included on master but also part of this PR. This should not be the case. |
| if err != nil { | ||
| return err | ||
| } | ||
| describeRoute.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{ |
| return err | ||
| } | ||
| describeRoute.GetObjectKind().SetGroupVersionKind(schema.GroupVersionKind{ | ||
| Group: "knative.dev", |
There was a problem hiding this comment.
its the wrong group anyway, but that gets fixed with #134.
rhuss
left a comment
There was a problem hiding this comment.
Thanks for the PR ! Technical its ok (except the missing rebase on master), but we should really agree what <noun> describe shoulde:
- Should it, like for kubectl, only be targetting human-readable output ? (there is no -o option for 'kubectl describe')
- Should
-o yaml|json|namebe exclusively reserved forkn revision list(withkubectl getbeing the equivalent for kubectl) ? Or is it ok to have it forkn revision describeto ? - Would be we good to rename
describetoshowto make the deviation tokubectlmore clear ? We already went fromgettolistso moving fromdescribetoshowwould be consiquent (and it would be then also easier to deviate fromkubectl describebehaviour like adding-ooptions).
@maximilien @sixolet @cppforlife @navidshaikh any opinions on this ?
| Group: "knative.dev", | ||
| Version: "v1alpha1", | ||
| Kind: "Route"}) | ||
| err = printer.PrintObj(describeRoute, cmd.OutOrStdout()) |
There was a problem hiding this comment.
'route describe' (or as I would love to rename it to 'route show', but that's another discussion ;) should imo really be about human readable output. I think its ok to have -o name|json|yaml, too but the main focus is to have a detaile out of the the routes, what revisions they are targetting which with which split and which service the route is targetting.
See #75 for the idea (although this PR is too huge and as soon as #134 is merged it will be broken down).
|
@zhangtbj : Thanks for your PR. Please check work done by @rhuss on #75 , we'd like to produce something like that. I'd say lets discuss info we'd like show for route |
|
I opened #235 for discussion the general direction we want to go with |
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zhangtbj The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Sorry I closed this PR by mistake. I created a new PR #251 which is rebased from master and change to use new knClient. Thanks! |
…y providing goos and goarch. (knative#228) * add go build with goos and goarch * add a example at help message --------- Co-authored-by: Kaustubh Pande <kaustubhpande.kp@gmail.com>
1, Implement kn route describe command with required parameters:
2, Add
gotest.toolstests for kn route describe commands:For issue: #205