-
Notifications
You must be signed in to change notification settings - Fork 261
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
💝 Extract reusable part of sink flag #1968
Conversation
Skipping CI for Draft Pull Request. |
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.
@cardil: 0 warnings.
In response to this:
Description
Changes
- 💝 Extract reusable part of sink flag
Reference
Fixes #
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-sigs/prow repository.
171dac3
to
aad8c15
Compare
b41d2b2
to
0c0828b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1968 +/- ##
==========================================
- Coverage 75.78% 75.77% -0.01%
==========================================
Files 228 234 +6
Lines 13411 13538 +127
==========================================
+ Hits 10163 10259 +96
- Misses 2425 2451 +26
- Partials 823 828 +5 ☔ View full report in Codecov by Sentry. |
0c0828b
to
0a7b3d1
Compare
/test all |
0a7b3d1
to
f8555e5
Compare
/test all |
/test all |
/test all |
@cardil thanks for the PR! I'll go trough the PR later today. |
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.
@dsimansk I added changes to the logging package, that I use in knative-extensions/kn-plugin-event#368 (just for the continence of working on that kn-event PR)
I can extract those changes to separate PR if you like.
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.
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.
Sure, that's fine. Thanks for highlighting it.
@@ -69,7 +69,7 @@ func TestSubscriptionList(t *testing.T) { | |||
assert.NilError(t, err) | |||
ol := strings.Split(out, "\n") | |||
assert.Check(t, util.ContainsAll(ol[0], "NAME", "CHANNEL", "SUBSCRIBER", "REPLY", "DEAD LETTER SINK", "READY", "REASON")) | |||
assert.Check(t, util.ContainsAll(ol[1], "s0", "InMemoryChannel:imc0", "ksvc:ksvc0", "broker:b00", "broker:b01")) | |||
assert.Check(t, util.ContainsAll(ol[1], "s0", "InMemoryChannel:imc0", "ksvc0", "broker:b00", "broker:b01")) |
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.
@cardil this ksvc
prefix was dropped because of changes in SinkToString
-> AsText()
functions? It might have been midly useful to have a type reference in this list. But not necessary required.
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.
Yes. I wrote the AsText
method to be as close as possible to the old one, but I thought that if we default to kservice in the input (ksvc:
, and kservice:
prefixes are optional), maybe we should also be consistent on the output side?
If you think, we should print those prefixes, even for kservice, then I can change it back.
BTW. Maybe we should deprecate the SinkAsString
method (in favor of AsText
), as it doesn't care about namespaces. If you target something from a different namespace, it will just print it by name, which is confusing to say the least.
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 see, OK let's keep it as optional. Apparently, judging by the test changes we haven't expected a lot of those types prefixes anyway.
// GetClientConfig gets ClientConfig from KubeCfgPath | ||
func (params *KnParams) GetClientConfig() (clientcmd.ClientConfig, error) { |
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.
Thanks, for cleaning this part. It seems like a very old piece, that doesn't make a lot of sense here.
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.
Yep. Now, the kubernetes related params are in their own struct, which makes far more sense.
BTW. I love the struct composition in Go. Such a great idea, they had...
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.
Ops, in my first comment I thought it's located in different file. I.e. that an isolated command tried to override the config loading. Anyway, it makes sense here, but it's fine to have it extracted as you did. All good here! :)
@cardil I have one question in subscription list output, but I'm not sure if it's any valid concern towards backwards compability or not. :) /lgmt |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cardil, dsimansk 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 |
/lgtm |
/unhold I'm OK to proceed with the merge. |
/unhold |
Description
Changes
Reference
Fixes #