Skip to content

Commit

Permalink
moved IsValidOfflineStoreFilePersistenceType to services package and …
Browse files Browse the repository at this point in the history
…use it in deploy flow

Signed-off-by: Daniele Martinoli <[email protected]>
  • Loading branch information
dmartinol authored and tmihalac committed Nov 19, 2024
1 parent 41aad67 commit 465223b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
14 changes: 1 addition & 13 deletions infra/feast-operator/api/v1alpha1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ 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 @@ -93,21 +91,11 @@ var ValidOfflineStoreFilePersistenceTypes = []string{
"duckdb",
}

var validOfflineStoreFilePersistenceType = []string{
var ValidOfflineStoreFilePersistenceTypes = []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,11 +77,7 @@ func (r *FeatureStoreReconciler) Reconcile(ctx context.Context, req ctrl.Request
currentStatus := cr.Status.DeepCopy()

// initial status defaults must occur before feast deployment
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
}
services.ApplyDefaultsToStatus(cr)
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 465223b

Please sign in to comment.