Skip to content

Commit

Permalink
e2e: mustgather: add missing deployer initialization
Browse files Browse the repository at this point in the history
Without the deployer initialization, deployment.deployer is nil and
causes the test to panic. Fix that by calling deploy.NewForPlatform().

Signed-off-by: Shereen Haj <[email protected]>
  • Loading branch information
shajmakh committed Dec 13, 2024
1 parent a53d5b3 commit 9cd43f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions test/e2e/must-gather/must_gather_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 4 additions & 1 deletion test/utils/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9cd43f1

Please sign in to comment.