Skip to content

Commit

Permalink
fix: Fix db store types in Operator CRD (#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 Nov 27, 2024
1 parent 1174239 commit f09339e
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 33 deletions.
18 changes: 9 additions & 9 deletions infra/feast-operator/api/v1alpha1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ var ValidOfflineStoreFilePersistenceTypes = []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 @@ -136,9 +136,9 @@ type OnlineStoreFilePersistence struct {
// OnlineStoreDBStorePersistence configures the DB store persistence for the offline store service
type OnlineStoreDBStorePersistence struct {
// +kubebuilder:validation:Enum=snowflake.online;redis;ikv;datastore;dynamodb;bigtable;postgres;cassandra;mysql;hazelcast;singlestore
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 ValidOnlineStoreDBStorePersistenceTypes = []string{
Expand Down Expand Up @@ -181,9 +181,9 @@ type RegistryFilePersistence struct {
// RegistryDBStorePersistence configures the DB store persistence for the registry service
type RegistryDBStorePersistence struct {
// +kubebuilder:validation:Enum=sql;snowflake.registry
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 ValidRegistryDBStorePersistenceTypes = []string{
Expand Down
24 changes: 6 additions & 18 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.

18 changes: 18 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 @@ -299,6 +299,9 @@ spec:
- feast_trino.trino.TrinoOfflineStore
- redis
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -614,6 +617,9 @@ spec:
- hazelcast
- singlestore
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -937,6 +943,9 @@ spec:
- sql
- snowflake.registry
type: string
required:
- secretRef
- type
type: object
type: object
resources:
Expand Down Expand Up @@ -1292,6 +1301,9 @@ spec:
- feast_trino.trino.TrinoOfflineStore
- redis
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -1612,6 +1624,9 @@ spec:
- hazelcast
- singlestore
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -1943,6 +1958,9 @@ spec:
- sql
- snowflake.registry
type: string
required:
- secretRef
- type
type: object
type: object
resources:
Expand Down
18 changes: 18 additions & 0 deletions infra/feast-operator/dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ spec:
- feast_trino.trino.TrinoOfflineStore
- redis
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -622,6 +625,9 @@ spec:
- hazelcast
- singlestore
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -945,6 +951,9 @@ spec:
- sql
- snowflake.registry
type: string
required:
- secretRef
- type
type: object
type: object
resources:
Expand Down Expand Up @@ -1300,6 +1309,9 @@ spec:
- feast_trino.trino.TrinoOfflineStore
- redis
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -1620,6 +1632,9 @@ spec:
- hazelcast
- singlestore
type: string
required:
- secretRef
- type
type: object
type: object
x-kubernetes-validations:
Expand Down Expand Up @@ -1951,6 +1966,9 @@ spec:
- sql
- snowflake.registry
type: string
required:
- secretRef
- type
type: object
type: object
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,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 @@ -200,7 +200,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 @@ -211,7 +211,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
6 changes: 3 additions & 3 deletions infra/feast-operator/internal/controller/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (feast *FeastServices) validateRegistryPersistence(registryPersistence *fea
return err
}

if dbPersistence.SecretRef != nil {
if len(dbPersistence.SecretRef.Name) > 0 {
secretRef := dbPersistence.SecretRef.Name
if _, err := feast.getSecret(secretRef); err != nil {
return err
Expand All @@ -131,7 +131,7 @@ func (feast *FeastServices) validateOnlineStorePersistence(onlinePersistence *fe
return err
}

if dbPersistence.SecretRef != nil {
if len(dbPersistence.SecretRef.Name) > 0 {
secretRef := dbPersistence.SecretRef.Name
if _, err := feast.getSecret(secretRef); err != nil {
return err
Expand All @@ -158,7 +158,7 @@ func (feast *FeastServices) validateOfflineStorePersistence(offlinePersistence *
return err
}

if dbPersistence.SecretRef != nil {
if len(dbPersistence.SecretRef.Name) > 0 {
secretRef := dbPersistence.SecretRef.Name
if _, err := feast.getSecret(secretRef); err != nil {
return err
Expand Down

0 comments on commit f09339e

Please sign in to comment.