-
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
fixes(#827): allow plugins to extend all command groups #834
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.
@maximilien: 1 warning.
In response to this:
Description
Allow
kn
plugins to extend existing command groups. So a plugin named:kn-service-blah
is now allowed. It extends theservice
command group with commandblah
. These extensions are for any existing command groups. This is per issue #827Changes
- allow plugins to extends all command groups, e.g., kn-service-blah is OK
- prevent plugins that shadow commands of existing groups, e.g., kn-service-create is NOT OK
- list plugins that extend existing groups
- warn plugins that shadow command of existing groups
- add UTs for above
Reference
Fixes #827
/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.
/ok-to-test |
To reviewers. Some local tests I have done that might be useful to verify this yourself. ➜ client git:(issue827) ./kn plugin list
/Users/maximilien/.config/kn/plugins/kn-curl
/Users/maximilien/.config/kn/plugins/kn-service-blah
/Users/maximilien/.config/kn/plugins/kn-service-create
/Users/maximilien/.config/kn/plugins/kn-source-create
/Users/maximilien/.config/kn/plugins/kn-source_github
ERROR:
- kn-service-create overwrites existing built-in command: kn service create
kn-service-create overwrites existing built-in command: kn service create
➜ client git:(issue827) cat /Users/maximilien/.config/kn/plugins/kn-service-blah
#!/bin/bash
echo "Hello kn: $1 $2"
➜ client git:(issue827) ./kn service blah max
Hello kn: max
➜ client git:(issue827) ./kn service create
required flag(s) "image" not set
➜ client git:(issue827) ./kn service list
NAME URL LATEST AGE CONDITIONS READY REASON
hello-world http://hello-world-default.kn-plugins-a4511d9cf0901749cf183d1384ce2bca-0000.sjc04.containers.appdomain.cloud hello-world-kzyhx-1 55d 3 OK / 3 True |
Ok looks like I need to add more tests to Will work on that tomorrow. /hold |
/hold cancel |
…is OK * prevent plugins that shadow commands of exsiting groups, e.g., kn-service-create is NOT OK * list plugins that extend existing groups * warn plugins that shadow command of existing groups * add UTs for above
Looks like I am still not over 50% coverage for |
* Wait on istio before installing knative serving * retry knative serving install if it fails * retry the serving install once after 60 second if it fails the first time * Added logs for the retry serving install and wait on istio components * Update comment for waiting on istio installation if necessary Co-Authored-By: Adriano Cunha <[email protected]>
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, looks good ! I have adde some minor comments/requests inline .
/retest go: github.com/google/licenseclassifier upgrade => v0.0.0-20200402202327-879cb1424de0
go: downloading github.com/sergi/go-diff v1.0.0
go: github.com/sergi/go-diff upgrade => v1.1.0
go: downloading github.com/sergi/go-diff v1.1.0
2020/05/22 21:54:37 Error creating license classifier: cannot register licenses: EOF
Step failed: default_build_test_runner
============================
==== BUILD TESTS FAILED ====
============================
==== Fri May 22 14:54:37 PDT 2020
============================
Step failed: run_build_tests
+ EXIT_VALUE=1
+ set +o xtrace |
Getting a weird error.... go: github.com/google/licenseclassifier upgrade => v0.0.0-20200402202327-879cb1424de0
go: downloading github.com/sergi/go-diff v1.0.0
go: github.com/sergi/go-diff upgrade => v1.1.0
go: downloading github.com/sergi/go-diff v1.1.0
2020/05/22 21:54:37 Error creating license classifier: cannot register licenses: EOF
Step failed: default_build_test_runner
============================
==== BUILD TESTS FAILED ====
============================
==== Fri May 22 14:54:37 PDT 2020
============================
Step failed: run_build_tests
+ EXIT_VALUE=1
+ set +o xtrace |
/retest |
Same consistent CI issue: 2020/05/22 21:54:37 Error creating license classifier: cannot register licenses: EOF
Step failed: default_build_test_runner I'll have to take a look at this next Tuesday --- long weekend here in US due to Memorial Day. |
Looks like an incompatible change in the test-infra scripts. @coryrc do you have an idea what has changed ? I think we have the same kind of error over there for client-contrib tests, too. |
/retest |
@maximilien the IT tests should be running again, but there's a conflict now which needs to be resolved. |
* addressed comments on PR * fix bug when dealing with sub sub-commands for known commands
OK thanks @rhuss and @navidshaikh. Just merged. Let's see what other tests I need to add or not. |
@rhuss and @navidshaikh this passes now and is ready. However, I want to make some small refactoring to simplify the code in |
* change root.go to match merge conflict * cleaned up NewDefaultKnCommandWithArgs call and added more comments
The following is the coverage report on the affected files.
|
Cool, let's get that merged now. As I'm starting to work now to include grouping for help messages (#579) and also to weave in plugin help message is needed. This will probably lead to some refactoring also in this part, so please don't touch those in the next week for now. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maximilien, 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 |
Description
Allow
kn
plugins to extend existing command groups. So a plugin named:kn-service-blah
is now allowed. It extends theservice
command group with commandblah
. These extensions are for any existing command groups. This is per issue #827Changes
Reference
Fixes #827
/lint