diff --git a/controllers/cluster_controller_test.go b/controllers/cluster_controller_test.go index 13f562e8e..633cfa537 100644 --- a/controllers/cluster_controller_test.go +++ b/controllers/cluster_controller_test.go @@ -2569,8 +2569,7 @@ var _ = Describe("cluster_controller", func() { Context("with a change to the process group ID prefix", func() { BeforeEach(func() { cluster.Spec.ProcessGroupIDPrefix = "dev" - err = k8sClient.Update(context.TODO(), cluster) - Expect(err).NotTo(HaveOccurred()) + Expect(k8sClient.Update(context.TODO(), cluster)).NotTo(HaveOccurred()) }) It("should replace the process groups", func() { @@ -2593,8 +2592,7 @@ var _ = Describe("cluster_controller", func() { It("should generate process group IDs with the new prefix", func() { pods := &corev1.PodList{} - err = k8sClient.List(context.TODO(), pods, getListOptions(cluster)...) - Expect(err).NotTo(HaveOccurred()) + Expect(k8sClient.List(context.TODO(), pods, getListOptions(cluster)...)).NotTo(HaveOccurred()) sortPodsByName(pods) Expect(pods.Items[0].Labels[fdbv1beta2.FDBProcessGroupIDLabel]).To(Equal("dev-cluster_controller-2")) diff --git a/e2e/test_operator/operator_test.go b/e2e/test_operator/operator_test.go index 7221de1ba..9e6bfc33c 100644 --- a/e2e/test_operator/operator_test.go +++ b/e2e/test_operator/operator_test.go @@ -755,8 +755,16 @@ var _ = Describe("Operator", Label("e2e", "pr"), func() { }) It("should add the prefix to all instances", func() { + for _, processGroup := range fdbCluster.GetCluster().Status.ProcessGroups { + Expect(string(processGroup.ProcessGroupID)).To(HavePrefix(prefix)) + } + pods := fdbCluster.GetPods() for _, pod := range pods.Items { + // Ignore any old Pods that are marked for removal. + if !pod.DeletionTimestamp.IsZero() { + continue + } Expect(string(fixtures.GetProcessGroupID(pod))).To(HavePrefix(prefix)) } })