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

Add url output for broker and channel #1118

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

arghya88
Copy link
Contributor

@arghya88 arghya88 commented Nov 12, 2020

Signed-off-by: Arghya Sadhu [email protected]

Description

Changes

*Add -o url to describe of channel and broker resources

Reference

Fixes #1093

/lint

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 12, 2020
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@arghya88: 0 warnings.

In response to this:

Signed-off-by: Arghya Sadhu [email protected]

Description

Changes

*Add -o url to describe of resources which can be accessed via URL

Reference

Fixes #1093

/lint

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 Nov 12, 2020
Copy link
Contributor

@maximilien maximilien left a 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 pretty useful shortcut since one can achieve the same with other output format, e.g., JSON path.

Curious what would happen if the service (or object in question) had multiple URLs, e.g., private and public. I guess you print both...

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 12, 2020
@maximilien
Copy link
Contributor

Seems like unit tests are failing in GH action with:

        
38
--- FAIL: TestCreateChannelWithTypeFlagInMemoryChannel (0.01s)
39
    mock_helper.go:104: assertion failed: 
40
        --- callArgs[i]
41
        +++ arg
42
          &v1beta1.Channel{
43
          	TypeMeta:   {},
44
          	ObjectMeta: {Name: "pipe"},
45
          	Spec:       {ChannelTemplate: &{TypeMeta: {Kind: "InMemoryChannel", APIVersion: "messaging.knative.dev/v1beta1"}}},
46
          	Status: v1beta1.ChannelStatus{
47
          		ChannelableStatus: v1beta1.ChannelableStatus{
48
          			Status:             {},
49
        - 			AddressStatus:      v1.AddressStatus{Address: &v1.Addressable{URL: s"http://pipe-channel.test"}},
50
        + 			AddressStatus:      v1.AddressStatus{},
51
          			SubscribableStatus: {},
52
          			DeadLetterChannel:  nil,
53
          		},
54
          		Channel: nil,
55
          	},
56
          }
57
        
58
FAIL
59

@arghya88 arghya88 force-pushed the describe-output branch 5 times, most recently from 8b4dd22 to 507899a Compare November 12, 2020 16:33
@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 13, 2020
@arghya88 arghya88 force-pushed the describe-output branch 3 times, most recently from a6673e5 to e71bca9 Compare November 13, 2020 04:17
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-client-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/kn/commands/broker/describe.go 84.0% 78.9% -5.1
pkg/kn/commands/channel/describe.go 76.9% 79.5% 2.6

@arghya88
Copy link
Contributor Author

/assign @navidshaikh

Copy link
Contributor

@maximilien maximilien left a comment

Choose a reason for hiding this comment

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

LGTM
@navidshaikh feel free to merge when ready

Copy link
Collaborator

@navidshaikh navidshaikh left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thanks @arghya88 !

@@ -74,11 +100,15 @@ func describeBroker(out io.Writer, broker *v1beta1.Broker, printDetails bool) er
dw := printers.NewPrefixWriter(out)
commands.WriteMetadata(dw, &broker.ObjectMeta, printDetails)
dw.WriteLine()
dw.WriteAttribute("Address", "").WriteAttribute("URL", broker.Status.Address.URL.String())
dw.WriteAttribute("Address", "").WriteAttribute("URL", extractURL(broker))
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍


# Print only channel URL
kn channel describe pipe -o url`

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arghya88, maximilien, navidshaikh

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:
  • OWNERS [maximilien,navidshaikh]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@navidshaikh
Copy link
Collaborator

/retest

@knative-prow-robot knative-prow-robot merged commit 688d9fc into knative:master Nov 17, 2020
@arghya88 arghya88 deleted the describe-output branch November 28, 2020 07:18
dsimansk added a commit to dsimansk/client that referenced this pull request Sep 6, 2022
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. 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.

Add -o url to describe of resources which can be accessed via URL
5 participants