From c2945d4cdba0f4298ed6896c9c138fb62745fe01 Mon Sep 17 00:00:00 2001 From: alecmerdler Date: Fri, 17 Jul 2020 12:21:36 -0700 Subject: [PATCH] look at the pods instead of deployments to verify assumptions in e2e tests --- controllers/quayregistry_controller_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/controllers/quayregistry_controller_test.go b/controllers/quayregistry_controller_test.go index 49470af1e..efe103939 100644 --- a/controllers/quayregistry_controller_test.go +++ b/controllers/quayregistry_controller_test.go @@ -177,11 +177,11 @@ var _ = Describe("QuayRegistryReconciler", func() { }) Context("on an existing `QuayRegistry`", func() { - var oldDeployments appsv1.DeploymentList + var oldPods corev1.PodList listOptions := client.ListOptions{Namespace: namespace} JustBeforeEach(func() { - _ = k8sClient.List(context.Background(), &oldDeployments, &listOptions) + _ = k8sClient.List(context.Background(), &oldPods, &listOptions) }) Context("which references a `configBundleSecret` that does not exist", func() { @@ -198,14 +198,15 @@ var _ = Describe("QuayRegistryReconciler", func() { }) It("will not update any Quay objects on the cluster", func() { - var deployments appsv1.DeploymentList + var pods corev1.PodList listOptions := client.ListOptions{Namespace: namespace} - _ = k8sClient.List(context.Background(), &deployments, &listOptions) - for _, deployment := range deployments.Items { - for _, oldDeployment := range oldDeployments.Items { - if deployment.GetName() == oldDeployment.GetName() { - Expect(deployment.Spec).To(Equal(oldDeployment.Spec)) + _ = k8sClient.List(context.Background(), &pods, &listOptions) + Expect(len(pods.Items)).To(Equal(len(oldPods.Items))) + for _, pod := range pods.Items { + for _, oldPod := range oldPods.Items { + if pod.GetName() == oldPod.GetName() { + Expect(pod.GetResourceVersion()).To(Equal(oldPod.GetResourceVersion())) } } }