Skip to content

Commit

Permalink
fix: Fix db store types in Operator CRD (feast-dev#4798)
Browse files Browse the repository at this point in the history
fix dbstore types

Signed-off-by: Tommy Hughes <[email protected]>
  • Loading branch information
tchughesiv authored and dharmisha committed Jan 15, 2025
1 parent 37b5340 commit 83a04d9
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 9 deletions.
18 changes: 15 additions & 3 deletions infra/feast-operator/api/v1alpha1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ var ValidOfflineStoreDBStorePersistenceTypes = []string{
// OfflineStoreDBStorePersistence configures the DB store persistence for the offline store service
type OfflineStoreDBStorePersistence struct {
// +kubebuilder:validation:Enum=snowflake.offline;bigquery;redshift;spark;postgres;feast_trino.trino.TrinoOfflineStore;redis
Type string `json:"type,omitempty"`
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
SecretKeyName string `json:"secretKeyName,omitempty"`
Type string `json:"type"`
SecretRef corev1.LocalObjectReference `json:"secretRef"`
SecretKeyName string `json:"secretKeyName,omitempty"`
}

var ValidOfflineStoreDBStorePersistenceTypes = []string{
Expand Down Expand Up @@ -190,10 +190,16 @@ type OnlineStoreDBStorePersistence struct {
SecretKeyName string `json:"secretKeyName,omitempty"`
=======
// +kubebuilder:validation:Enum=snowflake.online;redis;ikv;datastore;dynamodb;bigtable;postgres;cassandra;mysql;hazelcast;singlestore
<<<<<<< HEAD
Type string `json:"type,omitempty"`
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
SecretKeyName string `json:"secretKeyName,omitempty"`
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
Type string `json:"type"`
SecretRef corev1.LocalObjectReference `json:"secretRef"`
SecretKeyName string `json:"secretKeyName,omitempty"`
>>>>>>> cac619cfa (fix: Fix db store types in Operator CRD (#4798))
}

var ValidOnlineStoreDBStorePersistenceTypes = []string{
Expand Down Expand Up @@ -257,6 +263,7 @@ type RegistryFilePersistence struct {
// RegistryDBStorePersistence configures the DB store persistence for the registry service
type RegistryDBStorePersistence struct {
// +kubebuilder:validation:Enum=sql;snowflake.registry
<<<<<<< HEAD
<<<<<<< HEAD
Type string `json:"type"`
// Data store parameters should be placed as-is from the "feature_store.yaml" under the secret key. "registry_type" & "type" fields should be removed.
Expand All @@ -268,6 +275,11 @@ type RegistryDBStorePersistence struct {
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
SecretKeyName string `json:"secretKeyName,omitempty"`
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
Type string `json:"type"`
SecretRef corev1.LocalObjectReference `json:"secretRef"`
SecretKeyName string `json:"secretKeyName,omitempty"`
>>>>>>> cac619cfa (fix: Fix db store types in Operator CRD (#4798))
}

var ValidRegistryDBStorePersistenceTypes = []string{
Expand Down
18 changes: 15 additions & 3 deletions infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,13 @@ spec:
- feast_trino.trino.TrinoOfflineStore
- redis
type: string
<<<<<<< HEAD
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
required:
- secretRef
- type
>>>>>>> cac619cfa (fix: Fix db store types in Operator CRD (#4798))
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -910,6 +916,9 @@ spec:
- hazelcast
- singlestore
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -1396,6 +1405,9 @@ spec:
- sql
- snowflake.registry
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -1954,7 +1966,13 @@ spec:
- feast_trino.trino.TrinoOfflineStore
- redis
type: string
<<<<<<< HEAD
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
required:
- secretRef
- type
>>>>>>> cac619cfa (fix: Fix db store types in Operator CRD (#4798))
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -2439,6 +2457,9 @@ spec:
- hazelcast
- singlestore
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -2934,6 +2955,9 @@ spec:
- sql
- snowflake.registry
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down
24 changes: 24 additions & 0 deletions infra/feast-operator/dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,13 @@ spec:
- feast_trino.trino.TrinoOfflineStore
- redis
type: string
<<<<<<< HEAD
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
required:
- secretRef
- type
>>>>>>> cac619cfa (fix: Fix db store types in Operator CRD (#4798))
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -918,6 +924,9 @@ spec:
- hazelcast
- singlestore
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -1404,6 +1413,9 @@ spec:
- sql
- snowflake.registry
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -1962,7 +1974,13 @@ spec:
- feast_trino.trino.TrinoOfflineStore
- redis
type: string
<<<<<<< HEAD
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
required:
- secretRef
- type
>>>>>>> cac619cfa (fix: Fix db store types in Operator CRD (#4798))
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -2447,6 +2465,9 @@ spec:
- hazelcast
- singlestore
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -2942,6 +2963,9 @@ spec:
- sql
- snowflake.registry
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ var _ = Describe("Repo Config", func() {
Persistence: &feastdevv1alpha1.OfflineStorePersistence{
DBPersistence: &feastdevv1alpha1.OfflineStoreDBStorePersistence{
Type: string(OfflineDBPersistenceSnowflakeConfigType),
SecretRef: &corev1.LocalObjectReference{
SecretRef: corev1.LocalObjectReference{
Name: "offline-test-secret",
},
},
Expand All @@ -404,7 +404,7 @@ var _ = Describe("Repo Config", func() {
Persistence: &feastdevv1alpha1.OnlineStorePersistence{
DBPersistence: &feastdevv1alpha1.OnlineStoreDBStorePersistence{
Type: string(OnlineDBPersistenceSnowflakeConfigType),
SecretRef: &corev1.LocalObjectReference{
SecretRef: corev1.LocalObjectReference{
Name: "online-test-secret",
},
},
Expand All @@ -415,7 +415,7 @@ var _ = Describe("Repo Config", func() {
Persistence: &feastdevv1alpha1.RegistryPersistence{
DBPersistence: &feastdevv1alpha1.RegistryDBStorePersistence{
Type: string(RegistryDBPersistenceSnowflakeConfigType),
SecretRef: &corev1.LocalObjectReference{
SecretRef: corev1.LocalObjectReference{
Name: "registry-test-secret",
},
},
Expand Down
12 changes: 12 additions & 0 deletions infra/feast-operator/internal/controller/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,15 @@ func (feast *FeastServices) validateRegistryPersistence(registryPersistence *fea
return err
}

<<<<<<< HEAD
<<<<<<< HEAD
if len(dbPersistence.SecretRef.Name) > 0 {
=======
if dbPersistence.SecretRef != nil {
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
if len(dbPersistence.SecretRef.Name) > 0 {
>>>>>>> cac619cfa (fix: Fix db store types in Operator CRD (#4798))
secretRef := dbPersistence.SecretRef.Name
if _, err := feast.getSecret(secretRef); err != nil {
return err
Expand All @@ -211,11 +215,15 @@ func (feast *FeastServices) validateOnlineStorePersistence(onlinePersistence *fe
return err
}

<<<<<<< HEAD
<<<<<<< HEAD
if len(dbPersistence.SecretRef.Name) > 0 {
=======
if dbPersistence.SecretRef != nil {
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
if len(dbPersistence.SecretRef.Name) > 0 {
>>>>>>> cac619cfa (fix: Fix db store types in Operator CRD (#4798))
secretRef := dbPersistence.SecretRef.Name
if _, err := feast.getSecret(secretRef); err != nil {
return err
Expand All @@ -242,11 +250,15 @@ func (feast *FeastServices) validateOfflineStorePersistence(offlinePersistence *
return err
}

<<<<<<< HEAD
<<<<<<< HEAD
if len(dbPersistence.SecretRef.Name) > 0 {
=======
if dbPersistence.SecretRef != nil {
>>>>>>> 863a82cb7 (feat: Added feast Go operator db stores support (#4771))
=======
if len(dbPersistence.SecretRef.Name) > 0 {
>>>>>>> cac619cfa (fix: Fix db store types in Operator CRD (#4798))
secretRef := dbPersistence.SecretRef.Name
if _, err := feast.getSecret(secretRef); err != nil {
return err
Expand Down

0 comments on commit 83a04d9

Please sign in to comment.