diff --git a/test/e2e/must-gather/must_gather_suite_test.go b/test/e2e/must-gather/must_gather_suite_test.go index 838cdc423..84596c2f1 100644 --- a/test/e2e/must-gather/must_gather_suite_test.go +++ b/test/e2e/must-gather/must_gather_suite_test.go @@ -62,12 +62,13 @@ var _ = ginkgo.BeforeSuite(func() { mustGatherTag = getStringValueFromEnv(envVarMustGatherTag, defaultMustGatherTag) ginkgo.By(fmt.Sprintf("Using must-gather image %q tag %q", mustGatherImage, mustGatherTag)) + ginkgo.By("Fetching up cluster data") + var err error + // the error might be not nil we'll decide if that's fine or not depending on E2E_NROP_INFRA_SETUP_SKIP + deployment, err = deploy.GetDeploymentWithSched(context.TODO()) if _, ok := os.LookupEnv("E2E_NROP_INFRA_SETUP_SKIP"); ok { - ginkgo.By("Fetching up cluster data") - - var err error - deployment, err = deploy.GetDeploymentWithSched(context.TODO()) - gomega.Expect(err).ToNot(gomega.HaveOccurred()) + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "infra setup skip but Scheduler instance not found") + ginkgo.By("skip setting up the cluster") return } ginkgo.By("Setting up the cluster") diff --git a/test/utils/deploy/deploy.go b/test/utils/deploy/deploy.go index c3ee17bf5..7ae0bcf37 100644 --- a/test/utils/deploy/deploy.go +++ b/test/utils/deploy/deploy.go @@ -71,7 +71,10 @@ func NewForPlatform(plat platform.Platform) Deployer { } func GetDeploymentWithSched(ctx context.Context) (NroDeploymentWithSched, error) { - sd := NroDeploymentWithSched{} + sd := NroDeploymentWithSched{ + Deployer: NewForPlatform(configuration.Plat), + } + nroSchedKey := objects.NROSchedObjectKey() nroSchedObj := nropv1.NUMAResourcesScheduler{} err := e2eclient.Client.Get(ctx, nroSchedKey, &nroSchedObj)