From 54ae36330efac7cd1efb73362cba0c4079491e43 Mon Sep 17 00:00:00 2001 From: Friedrich Wilken Date: Fri, 8 Dec 2023 23:55:27 +0100 Subject: [PATCH] Simplify code. --- e2e/setup/setup_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/e2e/setup/setup_test.go b/e2e/setup/setup_test.go index e8906e89..d18c5310 100644 --- a/e2e/setup/setup_test.go +++ b/e2e/setup/setup_test.go @@ -196,10 +196,10 @@ func Test_PodsResources(t *testing.T) { // The number of Pods must be equal NATS.spec.cluster.size. We check this in the retry, because it may take // some time for all Pods to be there. - if len(pods.Items) != NATSCR().Spec.Cluster.Size { + if len(pods.Items) != NATSCR().Spec.Size { return fmt.Errorf( "error while fetching Pods; wanted %v Pods but got %v", - NATSCR().Spec.Cluster.Size, + NATSCR().Spec.Size, pods.Items, ) } @@ -223,10 +223,10 @@ func Test_PodsResources(t *testing.T) { } } } - if foundContainers != NATSCR().Spec.Cluster.Size { + if foundContainers != NATSCR().Spec.Size { return fmt.Errorf( "error while fethching 'natsCR' Containers: expected %v but found %v", - NATSCR().Spec.Cluster.Size, + NATSCR().Spec.Size, foundContainers, ) } @@ -258,9 +258,9 @@ func Test_PodsReady(t *testing.T) { // The number of Pods must be equal NATS.spec.cluster.size. We check this in the retry, because it may take // some time for all Pods to be there. - if len(pods.Items) != natsCR.Spec.Cluster.Size { + if len(pods.Items) != natsCR.Spec.Size { return fmt.Errorf( - "Error while fetching pods; wanted %v Pods but got %v", natsCR.Spec.Cluster.Size, pods.Items, + "Error while fetching pods; wanted %v Pods but got %v", natsCR.Spec.Size, pods.Items, ) } @@ -308,7 +308,7 @@ func Test_PVCs(t *testing.T) { // Check if the amount of PVCs is equal to the spec.cluster.size in the NATS CR. We do this in the retry, // because it may take some time for all PVCs to be there. - want, actual := NATSCR().Spec.Cluster.Size, len(pvcs.Items) + want, actual := NATSCR().Spec.Size, len(pvcs.Items) if want != actual { return fmt.Errorf("error while fetching PVSs; wanted %v PVCs but got %v", want, actual) }