Skip to content

Commit

Permalink
operator improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
  • Loading branch information
tchughesiv committed Jan 16, 2025
1 parent e9d0ff9 commit 77d9d1d
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ var _ = Describe("FeatureStore Controller", func() {
}, deploy)
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Template.Spec.ServiceAccountName).To(Equal(deploy.Name))
Expect(deploy.Spec.Strategy.Type).To(Equal(appsv1.RecreateDeploymentStrategyType))
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(1))
Expect(deploy.Spec.Template.Spec.Containers[0].Env).To(HaveLen(1))
env := getFeatureStoreYamlEnvVar(deploy.Spec.Template.Spec.Containers[0].Env)
Expand Down Expand Up @@ -267,6 +268,11 @@ var _ = Describe("FeatureStore Controller", func() {
// change feast project and reconcile
resourceNew := resource.DeepCopy()
resourceNew.Spec.FeastProject = "changed"
resourceNew.Spec.Services = &feastdevv1alpha1.FeatureStoreServices{
DeploymentStrategy: &appsv1.DeploymentStrategy{
Type: appsv1.RollingUpdateDeploymentStrategyType,
},
}
err = k8sClient.Update(ctx, resourceNew)
Expect(err).NotTo(HaveOccurred())
_, err = controllerReconciler.Reconcile(ctx, reconcile.Request{
Expand All @@ -285,6 +291,7 @@ var _ = Describe("FeatureStore Controller", func() {
Expect(err).NotTo(HaveOccurred())

testConfig.Project = resourceNew.Spec.FeastProject
Expect(deploy.Spec.Strategy.Type).To(Equal(appsv1.RollingUpdateDeploymentStrategyType))
Expect(deploy.Spec.Template.Spec.Containers[0].Env).To(HaveLen(1))
env = getFeatureStoreYamlEnvVar(deploy.Spec.Template.Spec.Containers[0].Env)
Expect(env).NotTo(BeNil())
Expand Down Expand Up @@ -1033,6 +1040,26 @@ var _ = Describe("FeatureStore Controller", func() {
}
Expect(repoConfigClient).To(Equal(clientConfig))

// disable init containers
resource.Spec.Services.DisableInitContainers = true
err = k8sClient.Update(ctx, resource)
Expect(err).NotTo(HaveOccurred())

_, err = controllerReconciler.Reconcile(ctx, reconcile.Request{
NamespacedName: nsName,
})
Expect(err).NotTo(HaveOccurred())

deploy = &appsv1.Deployment{}
objMeta = feast.GetObjectMeta()
err = k8sClient.Get(ctx, types.NamespacedName{
Name: objMeta.Name,
Namespace: objMeta.Namespace,
}, deploy)
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Template.Spec.InitContainers).To(BeEmpty())

// break remote reference
hostname := "test:80"
referencedRegistry.Spec.Services.Registry = &feastdevv1alpha1.Registry{
Remote: &feastdevv1alpha1.RemoteRegistryConfig{
Expand Down

0 comments on commit 77d9d1d

Please sign in to comment.