Fix plugin inlining that uses client-pkg dependency#1816
Fix plugin inlining that uses client-pkg dependency#1816knative-prow[bot] merged 3 commits intoknative:mainfrom
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1816 +/- ##
==========================================
- Coverage 79.74% 79.73% -0.01%
==========================================
Files 179 179
Lines 13890 13898 +8
==========================================
+ Hits 11076 11081 +5
- Misses 2052 2054 +2
- Partials 762 763 +1
☔ View full report in Codecov by Sentry. |
|
IIUC this is about moving the pluginmanager to If this is correct, the chance makes totally sense. However, I would also remove moved parts from the client hier as well. |
Yep, that's exact summary. I'll clean up the moved parts in a big bang sweep. :) |
|
/lgtm |
|
@vyasgun sorry, rebased now. :) |
|
/lgtm |
|
/retest |
|
/lgtm |
| // Merge plugins that implements client-pkg Plugin type to the same manager instance | ||
| for _, p := range pkgplugin.InternalPlugins { | ||
| pluginManager.AppendPlugin(p) | ||
| } | ||
|
|
There was a problem hiding this comment.
This part is important!
There're 2 gloabal variables:
clientInternalPluginsclient-pkgInternalPlugins
Depending in the plugin impl both are still valid, either by using new depedency or former on client repo. Therefore there's list merge to a single one that is used onward. I.e. content of client-pkg list is merged into client list.
|
/retest |
| pluginManager := plugin.NewManager(config.GlobalConfig.PluginsDir(), config.GlobalConfig.LookupPluginsInPath()) | ||
|
|
||
| // Merge plugins that implements client-pkg Plugin type to the same manager instance | ||
| for _, p := range pkgplugin.InternalPlugins { |
There was a problem hiding this comment.
I wonder whether we shouldn't put this internally in plugin.NewManager() where it feels more natural to me. It could be a lazy initialization (i.e. do only once regardless how often NewManager() is called). It would also keep main() a bit cleaner.
There was a problem hiding this comment.
Does it look better now? Agreed on moving the scope to constructor.
There was a problem hiding this comment.
thanks! (sorry, missed that ping)
/approve
/lgtm
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dsimansk, rhuss The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Fix plugin inlining that uses client-pkg dependency * Move list merge into plugin manager * Fix imports formatting
Description
Changes
This moves the initialization to new
client-pkg, otherwise the inlined plugins depending on client-pkg aren't recognized as expected./cc @rhuss @vyasgun
Reference
Fixes #
Release Note