-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e2e: mustgather: add missing deployer initialization #1115
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should never fail anyway so let's check err not occurred There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it can fail in case the cluster doesn't have the scheduler and we try to fetch it: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the question is why the sudden change? why are we always running the deployment, even if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my take is that we always want to have an instance of the current scheduler object. If the scheduler does already exist (skip setup), then we should just fetch the existing instance and move on; otherwise we need to setup it and then fetch the setupped instance. This is probably not too evident from the code and we likely need a bit larger refactoring. |
||
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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't make sense to conditionally check the error. If we need to do |
||
ginkgo.By("skip setting up the cluster") | ||
return | ||
} | ||
ginkgo.By("Setting up the cluster") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems correct There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to set it first thing in case the cluster didn't have the scheduler and fails to get it |
||
} | ||
|
||
nroSchedKey := objects.NROSchedObjectKey() | ||
nroSchedObj := nropv1.NUMAResourcesScheduler{} | ||
err := e2eclient.Client.Get(ctx, nroSchedKey, &nroSchedObj) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed. I'll make it "collect available data" does that sound better?