@@ -19,6 +19,7 @@ package loader
1919import (
2020 "errors"
2121 "fmt"
22+ "encoding/json"
2223
2324 "github.com/go-logr/logr"
2425 "k8s.io/apimachinery/pkg/runtime"
@@ -166,6 +167,7 @@ func decodeRawConfig(configBytes []byte) (*configapi.EndpointPickerConfig, error
166167
167168func 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