Skip to content

Commit

Permalink
Moved the util method to its own test file because it is used only once.
Browse files Browse the repository at this point in the history
Signed-off-by: lrangine <[email protected]>
  • Loading branch information
lokeshrangineni committed Jan 31, 2025
1 parent 9853774 commit 82360d7
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,57 +158,3 @@ func withEnvFrom() *[]corev1.EnvFromSource {
}

}

func createFeatureStoreVolumeResource(resourceName string, image string, pullPolicy corev1.PullPolicy) *feastdevv1alpha1.FeatureStore {
volume := corev1.Volume{
Name: "test-volume",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
}
volumeMount := corev1.VolumeMount{
Name: "test-volume",
MountPath: "/data",
}

return &feastdevv1alpha1.FeatureStore{
ObjectMeta: metav1.ObjectMeta{
Name: resourceName,
Namespace: "default",
},
Spec: feastdevv1alpha1.FeatureStoreSpec{
FeastProject: feastProject,
Services: &feastdevv1alpha1.FeatureStoreServices{
Volumes: []corev1.Volume{volume},
OfflineStore: &feastdevv1alpha1.OfflineStore{
ServiceConfigs: feastdevv1alpha1.ServiceConfigs{
OptionalConfigs: feastdevv1alpha1.OptionalConfigs{},
},
},
OnlineStore: &feastdevv1alpha1.OnlineStore{
VolumeMounts: []corev1.VolumeMount{volumeMount},
ServiceConfigs: feastdevv1alpha1.ServiceConfigs{
DefaultConfigs: feastdevv1alpha1.DefaultConfigs{
Image: &image,
},
OptionalConfigs: feastdevv1alpha1.OptionalConfigs{
ImagePullPolicy: &pullPolicy,
Resources: &corev1.ResourceRequirements{},
},
},
},
UI: &feastdevv1alpha1.UIService{
ServiceConfigs: feastdevv1alpha1.ServiceConfigs{
DefaultConfigs: feastdevv1alpha1.DefaultConfigs{
Image: &image,
},
OptionalConfigs: feastdevv1alpha1.OptionalConfigs{
ImagePullPolicy: &pullPolicy,
Resources: &corev1.ResourceRequirements{},
},
},
},
},
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package controller
import (
"context"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/feast-dev/feast/infra/feast-operator/internal/controller/handler"
"github.com/feast-dev/feast/infra/feast-operator/internal/controller/services"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
Expand Down Expand Up @@ -155,3 +157,57 @@ var _ = Describe("FeatureStore Controller - Deployment Volumes and VolumeMounts"
})
})
})

func createFeatureStoreVolumeResource(resourceName string, image string, pullPolicy corev1.PullPolicy) *feastdevv1alpha1.FeatureStore {
volume := corev1.Volume{
Name: "test-volume",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
}
volumeMount := corev1.VolumeMount{
Name: "test-volume",
MountPath: "/data",
}

return &feastdevv1alpha1.FeatureStore{
ObjectMeta: metav1.ObjectMeta{
Name: resourceName,
Namespace: "default",
},
Spec: feastdevv1alpha1.FeatureStoreSpec{
FeastProject: feastProject,
Services: &feastdevv1alpha1.FeatureStoreServices{
Volumes: []corev1.Volume{volume},
OfflineStore: &feastdevv1alpha1.OfflineStore{
ServiceConfigs: feastdevv1alpha1.ServiceConfigs{
OptionalConfigs: feastdevv1alpha1.OptionalConfigs{},
},
},
OnlineStore: &feastdevv1alpha1.OnlineStore{
VolumeMounts: []corev1.VolumeMount{volumeMount},
ServiceConfigs: feastdevv1alpha1.ServiceConfigs{
DefaultConfigs: feastdevv1alpha1.DefaultConfigs{
Image: &image,
},
OptionalConfigs: feastdevv1alpha1.OptionalConfigs{
ImagePullPolicy: &pullPolicy,
Resources: &corev1.ResourceRequirements{},
},
},
},
UI: &feastdevv1alpha1.UIService{
ServiceConfigs: feastdevv1alpha1.ServiceConfigs{
DefaultConfigs: feastdevv1alpha1.DefaultConfigs{
Image: &image,
},
OptionalConfigs: feastdevv1alpha1.OptionalConfigs{
ImagePullPolicy: &pullPolicy,
Resources: &corev1.ResourceRequirements{},
},
},
},
},
},
}
}

0 comments on commit 82360d7

Please sign in to comment.