Commit fe5dea3
authored
Reintroduce Plugin.Name() (#1057)
* rename Factory function as FactoryFunc
Signed-off-by: Etai Lev Ran <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* implement Name() for all plugins
Signed-off-by: Etai Lev Ran <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* change Name() comment
Signed-off-by: Etai Lev Ran <[email protected]>
---------
Signed-off-by: Etai Lev Ran <[email protected]>1 parent 36175ba commit fe5dea3
File tree
22 files changed
+308
-133
lines changed- api/config/v1alpha1
- conformance/testing-epp/plugins/filter
- pkg/epp
- common/config/loader
- plugins
- requestcontrol
- scheduling/framework
- plugins
- filter
- multi/prefix
- picker
- profile
- scorer
- test/testdata
22 files changed
+308
-133
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
| 138 | + | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
0 commit comments