-
Notifications
You must be signed in to change notification settings - Fork 179
Reintroduce Plugin.Name() #1057
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
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Hi @elevran. Thanks for your PR. I'm waiting for a kubernetes-sigs 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-sigs/prow repository. |
@elevran needs rebase... |
Signed-off-by: Etai Lev Ran <elevran@gmail.com>
JSON tags are not changed yet as it would impact all test files/sample YAML. Will be in a follow up commit. Signed-off-by: Etai Lev Ran <elevran@gmail.com>
Added comments describing test beyond the already descriptive name (e.g., field Plugins was initially called PluginReference so names can be a little misleading when using PluginRef - it's not the scheduling profile's references). Removed redundant test case (coverage is still 100%). Signed-off-by: Etai Lev Ran <elevran@gmail.com>
Change the JSON tag on type Change test files and test cases' text to use type instead of pluginName Signed-off-by: Etai Lev Ran <elevran@gmail.com>
@elevran I'm waiting with deeper review for a rebase. I think the motivation behind this PR (and the previous one) was to support multiple Plugins of the same type with different instance names (e.g., for logging). this should be the case when using configuration file but also when configuring plugins via code. I think current implementation has two problems: second, it creates plugin not through the More generally, I think all factory functions should call the matching This should allow us to configure name optionally via code (e.g., let me know if this makes sense. |
Signed-off-by: Etai Lev Ran <elevran@gmail.com>
Agree on both points. Will address this as part of this PR. |
Plugins (except testing only plugins) now allow calling WithName() to assign their name. Facory functions work by calling New() to avoid code duplication and centralize parameter checking. When constructing an unnamed Plugin, its name defaults to Type() Signed-off-by: Etai Lev Ran <elevran@gmail.com>
@nirrozenbaum rebased and added WithName() as suggested - you can review |
/ok-to-test |
pkg/epp/scheduling/framework/plugins/filter/least_kvcache_filter.go
Outdated
Show resolved
Hide resolved
pkg/epp/scheduling/framework/plugins/filter/least_kvcache_filter.go
Outdated
Show resolved
Hide resolved
Why should the two paths be different? If you are configuring via code, you can just build the literal object that the config API models, no? |
@kfswain it works the other way around.
they shouldn't, that was my comment :). |
+1; I don't think we need to provide a path for configuration other than the config api, unifying the ux on configuring the epp means we don't need to expose how the configuration get translated internally. So in main.go, |
For what its worth, this PR looks good to me. |
Right, thats what I am suggesting. The config API is modeling a scheduler. You can build the scheduler as needed. I guess I'm not understanding the need to make special consideration of configuring via code when that is the easier path, and not really impacted AFAICT |
Set plugin name to its type explicitly in New() Remove empty name check from WithName() Refine error message in config loading (added plugin name for missing type) Signed-off-by: Etai Lev Ran <elevran@gmail.com>
Signed-off-by: Etai Lev Ran <elevran@gmail.com>
@nirrozenbaum PTAL all suggested changes have been implemented |
/lgtm Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: elevran, nirrozenbaum 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 |
* rename Factory function as FactoryFunc Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Refactor field name from PluginName to Type JSON tags are not changed yet as it would impact all test files/sample YAML. Will be in a follow up commit. Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Review test cases Added comments describing test beyond the already descriptive name (e.g., field Plugins was initially called PluginReference so names can be a little misleading when using PluginRef - it's not the scheduling profile's references). Removed redundant test case (coverage is still 100%). Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Change pluginName to type in encoding Change the JSON tag on type Change test files and test cases' text to use type instead of pluginName Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement Name() for all plugins Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Added WithName() to all plugins Plugins (except testing only plugins) now allow calling WithName() to assign their name. Facory functions work by calling New() to avoid code duplication and centralize parameter checking. When constructing an unnamed Plugin, its name defaults to Type() Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement review comments Set plugin name to its type explicitly in New() Remove empty name check from WithName() Refine error message in config loading (added plugin name for missing type) Signed-off-by: Etai Lev Ran <elevran@gmail.com> * change Name() comment Signed-off-by: Etai Lev Ran <elevran@gmail.com> --------- Signed-off-by: Etai Lev Ran <elevran@gmail.com>
* rename Factory function as FactoryFunc Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Refactor field name from PluginName to Type JSON tags are not changed yet as it would impact all test files/sample YAML. Will be in a follow up commit. Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Review test cases Added comments describing test beyond the already descriptive name (e.g., field Plugins was initially called PluginReference so names can be a little misleading when using PluginRef - it's not the scheduling profile's references). Removed redundant test case (coverage is still 100%). Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Change pluginName to type in encoding Change the JSON tag on type Change test files and test cases' text to use type instead of pluginName Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement Name() for all plugins Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Added WithName() to all plugins Plugins (except testing only plugins) now allow calling WithName() to assign their name. Facory functions work by calling New() to avoid code duplication and centralize parameter checking. When constructing an unnamed Plugin, its name defaults to Type() Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement review comments Set plugin name to its type explicitly in New() Remove empty name check from WithName() Refine error message in config loading (added plugin name for missing type) Signed-off-by: Etai Lev Ran <elevran@gmail.com> * change Name() comment Signed-off-by: Etai Lev Ran <elevran@gmail.com> --------- Signed-off-by: Etai Lev Ran <elevran@gmail.com>
* rename Factory function as FactoryFunc Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Refactor field name from PluginName to Type JSON tags are not changed yet as it would impact all test files/sample YAML. Will be in a follow up commit. Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Review test cases Added comments describing test beyond the already descriptive name (e.g., field Plugins was initially called PluginReference so names can be a little misleading when using PluginRef - it's not the scheduling profile's references). Removed redundant test case (coverage is still 100%). Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Change pluginName to type in encoding Change the JSON tag on type Change test files and test cases' text to use type instead of pluginName Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement Name() for all plugins Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Added WithName() to all plugins Plugins (except testing only plugins) now allow calling WithName() to assign their name. Facory functions work by calling New() to avoid code duplication and centralize parameter checking. When constructing an unnamed Plugin, its name defaults to Type() Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement review comments Set plugin name to its type explicitly in New() Remove empty name check from WithName() Refine error message in config loading (added plugin name for missing type) Signed-off-by: Etai Lev Ran <elevran@gmail.com> * change Name() comment Signed-off-by: Etai Lev Ran <elevran@gmail.com> --------- Signed-off-by: Etai Lev Ran <elevran@gmail.com>
* rename Factory function as FactoryFunc Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Refactor field name from PluginName to Type JSON tags are not changed yet as it would impact all test files/sample YAML. Will be in a follow up commit. Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Review test cases Added comments describing test beyond the already descriptive name (e.g., field Plugins was initially called PluginReference so names can be a little misleading when using PluginRef - it's not the scheduling profile's references). Removed redundant test case (coverage is still 100%). Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Change pluginName to type in encoding Change the JSON tag on type Change test files and test cases' text to use type instead of pluginName Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement Name() for all plugins Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Added WithName() to all plugins Plugins (except testing only plugins) now allow calling WithName() to assign their name. Facory functions work by calling New() to avoid code duplication and centralize parameter checking. When constructing an unnamed Plugin, its name defaults to Type() Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement review comments Set plugin name to its type explicitly in New() Remove empty name check from WithName() Refine error message in config loading (added plugin name for missing type) Signed-off-by: Etai Lev Ran <elevran@gmail.com> * change Name() comment Signed-off-by: Etai Lev Ran <elevran@gmail.com> --------- Signed-off-by: Etai Lev Ran <elevran@gmail.com>
* rename Factory function as FactoryFunc Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Refactor field name from PluginName to Type JSON tags are not changed yet as it would impact all test files/sample YAML. Will be in a follow up commit. Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Review test cases Added comments describing test beyond the already descriptive name (e.g., field Plugins was initially called PluginReference so names can be a little misleading when using PluginRef - it's not the scheduling profile's references). Removed redundant test case (coverage is still 100%). Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Change pluginName to type in encoding Change the JSON tag on type Change test files and test cases' text to use type instead of pluginName Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement Name() for all plugins Signed-off-by: Etai Lev Ran <elevran@gmail.com> * Added WithName() to all plugins Plugins (except testing only plugins) now allow calling WithName() to assign their name. Facory functions work by calling New() to avoid code duplication and centralize parameter checking. When constructing an unnamed Plugin, its name defaults to Type() Signed-off-by: Etai Lev Ran <elevran@gmail.com> * implement review comments Set plugin name to its type explicitly in New() Remove empty name check from WithName() Refine error message in config loading (added plugin name for missing type) Signed-off-by: Etai Lev Ran <elevran@gmail.com> * change Name() comment Signed-off-by: Etai Lev Ran <elevran@gmail.com> --------- Signed-off-by: Etai Lev Ran <elevran@gmail.com>
This is a follow up to #1038.
Fixes #1008
Plugin changes (cc: @ahg-g @kfswain @nirrozenbaum)
EPP Configuration changes, see 1038 comment (cc: @shmuelk @ahg-g)
type
instead ofpluginName