-
Notifications
You must be signed in to change notification settings - Fork 551
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
change Lister to DynamicClient for subscription clean up in Teardown #2616
change Lister to DynamicClient for subscription clean up in Teardown #2616
Conversation
test/e2e/util.go
Outdated
if list != nil { | ||
remaining = list.Items | ||
Eventually(func() ([]unstructured.Unstructured, error) { | ||
var subscriptiongvr = schema.GroupVersionResource{Group: "operators.coreos.com", Version: "v1alpha1", Resource: "subscriptions"} |
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.
nit: could we move this assignment out of the Eventually()
into the var block above since it only needs to be done once (and is not part of the core polling logic)?
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.
Sure. I'll move it. Thanks!
remaining = list.Items | ||
Eventually(func() ([]unstructured.Unstructured, error) { | ||
var subscriptiongvr = schema.GroupVersionResource{Group: "operators.coreos.com", Version: "v1alpha1", Resource: "subscriptions"} | ||
list, err := dynamic.Resource(subscriptiongvr).Namespace(namespace).List(context.Background(), metav1.ListOptions{}) |
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.
I think this logic makes sense, moving the call from the cache to the api-server. Maybe if this works well we can expand the change to the other types in TearDown()
as well.
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.
Sounds good to me. Thanks!
0baceb8
to
4a0ccde
Compare
Signed-off-by: akihikokuroda <[email protected]>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akihikokuroda, timflannagan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: akihikokuroda [email protected]
Description of the change:
This line
operator-lifecycle-manager/test/e2e/util.go
Line 403 in ac4de75
This line
operator-lifecycle-manager/test/e2e/util.go
Line 408 in ac4de75
DeleteAllOf
function deletes the subscriptions in the cache and theLIst
function gets the instance from the cache.This PR changes the way to get the subscriptions from the API server directly instead of the cache.
Motivation for the change:
Closes #2615
Reviewer Checklist
/doc