diff --git a/infra/feast-operator/api/v1alpha1/featurestore_types.go b/infra/feast-operator/api/v1alpha1/featurestore_types.go index 50bf682213f..5907ca87206 100644 --- a/infra/feast-operator/api/v1alpha1/featurestore_types.go +++ b/infra/feast-operator/api/v1alpha1/featurestore_types.go @@ -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{ @@ -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{ @@ -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{ diff --git a/infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go b/infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go index 196b2147005..be0a4201efd 100644 --- a/infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go +++ b/infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go @@ -239,11 +239,7 @@ func (in *OfflineStore) DeepCopy() *OfflineStore { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OfflineStoreDBStorePersistence) DeepCopyInto(out *OfflineStoreDBStorePersistence) { *out = *in - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) - **out = **in - } + out.SecretRef = in.SecretRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OfflineStoreDBStorePersistence. @@ -287,7 +283,7 @@ func (in *OfflineStorePersistence) DeepCopyInto(out *OfflineStorePersistence) { if in.DBPersistence != nil { in, out := &in.DBPersistence, &out.DBPersistence *out = new(OfflineStoreDBStorePersistence) - (*in).DeepCopyInto(*out) + **out = **in } } @@ -325,11 +321,7 @@ func (in *OnlineStore) DeepCopy() *OnlineStore { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OnlineStoreDBStorePersistence) DeepCopyInto(out *OnlineStoreDBStorePersistence) { *out = *in - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) - **out = **in - } + out.SecretRef = in.SecretRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OnlineStoreDBStorePersistence. @@ -373,7 +365,7 @@ func (in *OnlineStorePersistence) DeepCopyInto(out *OnlineStorePersistence) { if in.DBPersistence != nil { in, out := &in.DBPersistence, &out.DBPersistence *out = new(OnlineStoreDBStorePersistence) - (*in).DeepCopyInto(*out) + **out = **in } } @@ -497,11 +489,7 @@ func (in *Registry) DeepCopy() *Registry { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RegistryDBStorePersistence) DeepCopyInto(out *RegistryDBStorePersistence) { *out = *in - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.LocalObjectReference) - **out = **in - } + out.SecretRef = in.SecretRef } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryDBStorePersistence. @@ -556,7 +544,7 @@ func (in *RegistryPersistence) DeepCopyInto(out *RegistryPersistence) { if in.DBPersistence != nil { in, out := &in.DBPersistence, &out.DBPersistence *out = new(RegistryDBStorePersistence) - (*in).DeepCopyInto(*out) + **out = **in } } diff --git a/infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml b/infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml index f1c7fca8f51..e4f1357cbaf 100644 --- a/infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml +++ b/infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml @@ -299,6 +299,9 @@ spec: - feast_trino.trino.TrinoOfflineStore - redis type: string + required: + - secretRef + - type type: object type: object x-kubernetes-validations: @@ -614,6 +617,9 @@ spec: - hazelcast - singlestore type: string + required: + - secretRef + - type type: object type: object x-kubernetes-validations: @@ -937,6 +943,9 @@ spec: - sql - snowflake.registry type: string + required: + - secretRef + - type type: object type: object resources: @@ -1292,6 +1301,9 @@ spec: - feast_trino.trino.TrinoOfflineStore - redis type: string + required: + - secretRef + - type type: object type: object x-kubernetes-validations: @@ -1612,6 +1624,9 @@ spec: - hazelcast - singlestore type: string + required: + - secretRef + - type type: object type: object x-kubernetes-validations: @@ -1943,6 +1958,9 @@ spec: - sql - snowflake.registry type: string + required: + - secretRef + - type type: object type: object resources: diff --git a/infra/feast-operator/dist/install.yaml b/infra/feast-operator/dist/install.yaml index 83181f53b09..2b02676baf6 100644 --- a/infra/feast-operator/dist/install.yaml +++ b/infra/feast-operator/dist/install.yaml @@ -307,6 +307,9 @@ spec: - feast_trino.trino.TrinoOfflineStore - redis type: string + required: + - secretRef + - type type: object type: object x-kubernetes-validations: @@ -622,6 +625,9 @@ spec: - hazelcast - singlestore type: string + required: + - secretRef + - type type: object type: object x-kubernetes-validations: @@ -945,6 +951,9 @@ spec: - sql - snowflake.registry type: string + required: + - secretRef + - type type: object type: object resources: @@ -1300,6 +1309,9 @@ spec: - feast_trino.trino.TrinoOfflineStore - redis type: string + required: + - secretRef + - type type: object type: object x-kubernetes-validations: @@ -1620,6 +1632,9 @@ spec: - hazelcast - singlestore type: string + required: + - secretRef + - type type: object type: object x-kubernetes-validations: @@ -1951,6 +1966,9 @@ spec: - sql - snowflake.registry type: string + required: + - secretRef + - type type: object type: object resources: diff --git a/infra/feast-operator/internal/controller/services/repo_config_test.go b/infra/feast-operator/internal/controller/services/repo_config_test.go index eaeeb4ea09f..cb3c4dabfe9 100644 --- a/infra/feast-operator/internal/controller/services/repo_config_test.go +++ b/infra/feast-operator/internal/controller/services/repo_config_test.go @@ -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", }, }, @@ -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", }, }, @@ -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", }, }, diff --git a/infra/feast-operator/internal/controller/services/services.go b/infra/feast-operator/internal/controller/services/services.go index 4667c8158ad..7974ee997bd 100644 --- a/infra/feast-operator/internal/controller/services/services.go +++ b/infra/feast-operator/internal/controller/services/services.go @@ -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 @@ -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 @@ -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