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 173bd39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 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,12 @@ 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
deployment, err = deploy.GetDeploymentWithSched(context.TODO(), configuration.Plat)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
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())
ginkgo.By("skip setting up the cluster")
return
}
ginkgo.By("Setting up the cluster")
Expand Down
3 changes: 2 additions & 1 deletion test/utils/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ func NewForPlatform(plat platform.Platform) Deployer {
}
}

func GetDeploymentWithSched(ctx context.Context) (NroDeploymentWithSched, error) {
func GetDeploymentWithSched(ctx context.Context, platf platform.Platform) (NroDeploymentWithSched, error) {
sd := NroDeploymentWithSched{}
nroSchedKey := objects.NROSchedObjectKey()
nroSchedObj := nropv1.NUMAResourcesScheduler{}
err := e2eclient.Client.Get(ctx, nroSchedKey, &nroSchedObj)
if err != nil {
return sd, err
}
sd.Deployer = NewForPlatform(configuration.Plat)
sd.NroSchedObj = &nroSchedObj

return sd, nil
Expand Down

0 comments on commit 173bd39

Please sign in to comment.