Skip to content

Commit 7f23117

Browse files
committed
Also add params
1 parent 54e4779 commit 7f23117

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pkg/epp/config/loader/configloader.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package loader
1818

1919
import (
20+
"encoding/json"
2021
"errors"
2122
"fmt"
2223

@@ -166,6 +167,7 @@ func decodeRawConfig(configBytes []byte) (*configapi.EndpointPickerConfig, error
166167

167168
func instantiatePlugins(configuredPlugins []configapi.PluginSpec, handle fwkplugin.Handle) error {
168169
pluginNames := sets.New[string]()
170+
var approxPrefixCacheParams json.RawMessage
169171
foundPrefixCacheScorer := false
170172
for _, spec := range configuredPlugins {
171173
if spec.Type == "" {
@@ -191,10 +193,11 @@ func instantiatePlugins(configuredPlugins []configapi.PluginSpec, handle fwkplug
191193
// This is due to historical reasons where the scorer plugin was developed before the dataproducer plugins were introduced.
192194
if spec.Type == prefix.PrefixCacheScorerPluginType {
193195
foundPrefixCacheScorer = true
196+
approxPrefixCacheParams = spec.Parameters
194197
}
195198
}
196199
if foundPrefixCacheScorer && !existsByType(handle, reqdataprodprefix.ApproxPrefixCachePluginType) {
197-
plugin, err := reqdataprodprefix.ApproxPrefixCacheFactory(reqdataprodprefix.ApproxPrefixCachePluginType, nil, handle)
200+
plugin, err := reqdataprodprefix.ApproxPrefixCacheFactory(reqdataprodprefix.ApproxPrefixCachePluginType, approxPrefixCacheParams, handle)
198201
if err != nil {
199202
return fmt.Errorf("failed to create ApproxPrefixCache plugin for prefix cache plugin: %w", err)
200203
}

0 commit comments

Comments
 (0)