@@ -367,5 +367,67 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
367367 testConfig .Registry .S3AdditionalKwargs = nil
368368 Expect (repoConfig ).To (Equal (& testConfig ))
369369 })
370+
371+ It ("should propagate registry file cache settings into repo config" , func () {
372+ By ("Reconciling the created resource with registry cache settings" )
373+ controllerReconciler := & FeatureStoreReconciler {
374+ Client : k8sClient ,
375+ Scheme : k8sClient .Scheme (),
376+ }
377+
378+ // update the FeatureStore to set cache settings on registry file persistence
379+ resource := & feastdevv1alpha1.FeatureStore {}
380+ err := k8sClient .Get (ctx , typeNamespacedName , resource )
381+ Expect (err ).NotTo (HaveOccurred ())
382+
383+ ttl := int32 (300 )
384+ mode := "thread"
385+ resource .Spec .Services .Registry .Local .Persistence .FilePersistence .CacheTTLSeconds = & ttl
386+ resource .Spec .Services .Registry .Local .Persistence .FilePersistence .CacheMode = & mode
387+ err = k8sClient .Update (ctx , resource )
388+ Expect (err ).NotTo (HaveOccurred ())
389+
390+ _ , err = controllerReconciler .Reconcile (ctx , reconcile.Request {
391+ NamespacedName : typeNamespacedName ,
392+ })
393+ Expect (err ).NotTo (HaveOccurred ())
394+
395+ // fetch updated resource and deployment
396+ resource = & feastdevv1alpha1.FeatureStore {}
397+ err = k8sClient .Get (ctx , typeNamespacedName , resource )
398+ Expect (err ).NotTo (HaveOccurred ())
399+
400+ feast := services.FeastServices {
401+ Handler : handler.FeastHandler {
402+ Client : controllerReconciler .Client ,
403+ Context : ctx ,
404+ Scheme : controllerReconciler .Scheme ,
405+ FeatureStore : resource ,
406+ },
407+ }
408+
409+ deploy := & appsv1.Deployment {}
410+ objMeta := feast .GetObjectMeta ()
411+ err = k8sClient .Get (ctx , types.NamespacedName {
412+ Name : objMeta .Name ,
413+ Namespace : objMeta .Namespace ,
414+ }, deploy )
415+ Expect (err ).NotTo (HaveOccurred ())
416+
417+ env := getFeatureStoreYamlEnvVar (services .GetRegistryContainer (* deploy ).Env )
418+ Expect (env ).NotTo (BeNil ())
419+
420+ // decode feature_store.yaml and verify registry cache settings
421+ envByte , err := base64 .StdEncoding .DecodeString (env .Value )
422+ Expect (err ).NotTo (HaveOccurred ())
423+ repoConfig := & services.RepoConfig {}
424+ err = yaml .Unmarshal (envByte , repoConfig )
425+ Expect (err ).NotTo (HaveOccurred ())
426+
427+ Expect (repoConfig .Registry .CacheTTLSeconds ).NotTo (BeNil ())
428+ Expect (* repoConfig .Registry .CacheTTLSeconds ).To (Equal (ttl ))
429+ Expect (repoConfig .Registry .CacheMode ).NotTo (BeNil ())
430+ Expect (* repoConfig .Registry .CacheMode ).To (Equal (mode ))
431+ })
370432 })
371433})
0 commit comments