-
Notifications
You must be signed in to change notification settings - Fork 262
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
Support multi config files #222
Support multi config files #222
Conversation
Hi @edwardstudy. 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. 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 |
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 the PR !
Do you think it would be possible to write a test for this, too ? We should do this if the test setup is not so involved that it does not justify the benefit.
54ea5af
to
fb52411
Compare
fb52411
to
da126c0
Compare
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.
Tanks a lot. Funny thing is that the coverage report fails now after you added a test (and we didn't have a test before that for types.go). So I'm not sure how this check is supposed to work, as it seems like having 0% coverage is ok, but if you have a coverage >0% then you do need to have more than 50%.
Not sure how we can resolve that (except by writing more test code unrelated to this PR).
@sixolet @adrcunha Is there a way to "overrule" the code coverage check ? Or what is the recommendation for this kind of situation ?
I think the coverage check was marked as required by mistake, based on the numbers in https://testgrid.knative.dev/client#coverage Unless you feel very confident that, at this point that no PR with coverage below 50% should get merged, I suggest that an admin simply uncheck the go coverage job as required to merge. |
i dont think kubectl supports following (someone verify:
it does support KUBECONFIG having multiple paths set though which we support as well via kubectl's library. original issue mentioned in this pr is fixed via #172. |
good catch, @cppforlife
correct, I get an error with a
@edwardstudy sorry for bugging you with the test and change (really good work, thx again), but what was actually your use case ? Does setting |
explicitPath string | ||
} | ||
|
||
func TestGetClientConfig(t *testing.T) { |
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.
Nice work @edwardstudy. Consider also using the new gotest.tools
which should make your tests cleaner, especially assertions and dividing into multiple parts. We agreed during yesterday's WG meeting to move all tests using this small addition to gotest.tools
. See #134's tests for examples or let's chat today in Beijing, I am working on some. Cheers 🍻
@rhuss My case is simple, specify multi configs over |
For multiple configs, I think that
I think your use case can be simply be done with
instead of using one We should mimic the behaviour of I totally agree thought that the error message should be better, maybe even suggesting that The current kubectl behaviour is:
For the last case, I suggest an error message like
The last sentence I would add when the path contains a @edwardstudy does this make sense ? |
da126c0
to
8aececb
Compare
/retest |
8aececb
to
5d61997
Compare
@rhuss Hi, I recoded and let |
Let me jump on the PR later (probably tomorrow, its already late here). Thanks for doing the rework ! |
/retest (sorry, test failure is again because of a too short timeout in the it test. We will address this soonish). |
/retest |
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.
direction looks very good. Some minor nits, mostly around testing.
@edwardstudy you also need to rebase to resolve |
5d61997
to
0bdbd06
Compare
pkg/kn/commands/types.go
Outdated
|
||
paths := filepath.SplitList(params.KubeCfgPath) | ||
if len(paths) > 1 { | ||
return nil, errors.New(fmt.Sprintf("Can not find config file. '%s' looks like a combine path. "+ |
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.
return nil, errors.New(fmt.Sprintf("Can not find config file. '%s' looks like a combine path. "+ | |
return nil, errors.New(fmt.Sprintf("Can not find config file. '%s' looks like a path. "+ |
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 a lot ! Except for one super-mini correction (where I provide a suggestion) at https://github.com/knative/client/pull/222/files#r304285543 we are good to merge.
Done. Sorry for the delay in getting a chance to respond to this PR. |
0bdbd06
to
e9a13d1
Compare
e9a13d1
to
051e136
Compare
The following is the coverage report on pkg/.
|
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edwardstudy, rhuss 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 |
Fixed: #196