Skip to content

Commit

Permalink
added IsValidOfflineStoreFilePersistenceType to the API definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Daniele Martinoli <[email protected]>
  • Loading branch information
dmartinol authored and tmihalac committed Nov 19, 2024
1 parent cde5760 commit 41aad67
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 17 additions & 0 deletions infra/feast-operator/api/v1alpha1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package v1alpha1

import (
"fmt"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -91,6 +93,21 @@ var ValidOfflineStoreFilePersistenceTypes = []string{
"duckdb",
}

var validOfflineStoreFilePersistenceType = []string{
"dask",
"duckdb",
}

// A function to validate the file persistence types for offline stores
func IsValidOfflineStoreFilePersistenceType(value string) (bool, error) {
for _, v := range validOfflineStoreFilePersistenceType {
if v == value {
return true, nil
}
}
return false, fmt.Errorf("invalid file type %s for offline store", value)
}

// OnlineStore configures the deployed online store service
type OnlineStore struct {
ServiceConfigs `json:",inline"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ func (r *FeatureStoreReconciler) Reconcile(ctx context.Context, req ctrl.Request
currentStatus := cr.Status.DeepCopy()

// initial status defaults must occur before feast deployment
services.ApplyDefaultsToStatus(cr)
if err := services.ApplyDefaultsToStatus(cr); err != nil {
logger.Error(err, "Error updating the FeatureStore status")
result = ctrl.Result{Requeue: true, RequeueAfter: RequeueDelayError}
return result, err
}
result, recErr = r.deployFeast(ctx, cr)
if cr.DeletionTimestamp == nil && !reflect.DeepEqual(currentStatus, cr.Status) {
if err = r.Client.Status().Update(ctx, cr); err != nil {
Expand Down

0 comments on commit 41aad67

Please sign in to comment.