-
Notifications
You must be signed in to change notification settings - Fork 263
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
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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...
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
|
8b4dd22
to
507899a
Compare
a6673e5
to
e71bca9
Compare
Signed-off-by: Arghya Sadhu <[email protected]>
e71bca9
to
252bd7d
Compare
The following is the coverage report on the affected files.
|
/assign @navidshaikh |
There was a problem hiding this 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
There was a problem hiding this 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)) |
There was a problem hiding this comment.
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` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
[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:
Approvers can indicate their approval by writing |
/retest |
Signed-off-by: Arghya Sadhu [email protected]
Description
Changes
*Add -o url to describe of channel and broker resources
Reference
Fixes #1093
/lint