-
Notifications
You must be signed in to change notification settings - Fork 118
Bulk delete namespaces in reconfiguration nfr test #3402
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
base: main
Are you sure you want to change the base?
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 | ||||
---|---|---|---|---|---|---|
|
@@ -170,16 +170,12 @@ var _ = Describe("Reconfiguration Performance Testing", Ordered, Label("nfr", "r | |||||
cleanupResources := func() error { | ||||||
var err error | ||||||
|
||||||
// FIXME (bjee19): https://github.com/nginx/nginx-gateway-fabric/issues/2376 | ||||||
// Find a way to bulk delete these namespaces. | ||||||
for i := 1; i <= maxResourceCount; i++ { | ||||||
nsName := "namespace" + strconv.Itoa(i) | ||||||
resultError := resourceManager.DeleteNamespace(nsName) | ||||||
if resultError != nil { | ||||||
err = resultError | ||||||
} | ||||||
namespaces := make([]string, maxResourceCount) | ||||||
for i := range maxResourceCount { | ||||||
namespaces[i] = "namespace" + strconv.Itoa(i+1) | ||||||
} | ||||||
|
||||||
err = resourceManager.DeleteNamespaces(namespaces) | ||||||
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.
Suggested change
Or do you want to return this error? 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. There might be a better way to do this, but we do have an Do you know if there is another way around this? 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. Oh I see...I guess let's just leave as-is for now. |
||||||
Expect(resourceManager.DeleteNamespace(reconfigNamespace.Name)).To(Succeed()) | ||||||
|
||||||
return err | ||||||
|
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.
Do we need the Get call first? Can we just call delete and check for the same IsNotFound error?
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.
Let me see, i know that Get is used to populate ns so that Delete works because Delete needs the populated ns object, however if all it needs is just the name, yea we can remove the Get call and manually make the ns object for delete.