-
Notifications
You must be signed in to change notification settings - Fork 1.2k
🐛 Update List in namespaced client to list objects that are cluster scoped #3351
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
🐛 Update List in namespaced client to list objects that are cluster scoped #3351
Conversation
|
I can add a test for this |
7bd96c1 to
f5174cf
Compare
Signed-off-by: Troy Connor <troy0820@users.noreply.github.com>
f5174cf to
3153d31
Compare
|
/test pull-controller-runtime-test |
alvaroaleman
left a comment
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.
thanks!
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, troy0820 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 |
|
LGTM label has been added. Git tree hash: f68e39039b0c1886ac02565ab8637e2a44b0e174
|
| result := &corev1.NodeList{} | ||
| opts := &client.ListOptions{} | ||
| Expect(getClient().List(ctx, result, opts)).NotTo(HaveOccurred()) | ||
| Expect(result.Items).NotTo(BeEmpty()) |
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.
Will this work? We are not creating a node in the beforeEach or did I miss it?
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.
We are not creating a node but a node exist? I am making the assumption but when tested it showed that the node exists when querying the result.
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 had to change it from len(result.Items) to EXPECT(result.Items) to not be Empty when that gave me 9. The test passes showing that the nodelist is not empty.
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.
Hm. This seems to fail on my Machine somehow (at least when run with Intellij)? Which Nodes do you get?
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.
Is it possible the node object(s) get created by other tests running in parallel using the same client? That would both explain the flaking and the inability to use len.
Sorry, I missed this before approving
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.
Probably. We could also simply make this case self-contained by creating a Node with some namespaced prefix
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.
The flakiness of this is unfortunate because I made the assumption that because the node is there, it is always there. We can contain it by creating a node in the Before Spec if that helps with the testing suite.
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.
#3353 <-- Follow up for updating the test.
|
/cherry-pick release-0.22 |
|
@troy0820: new pull request created: #3352 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Resolves #3347