-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
🐛 Populate GVK for listed objects #296
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: liyinan926 If they are not already assigned, you can assign the PR to them by writing 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 |
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.
LGTM
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.
test change, otherwise looks good
pkg/cache/cache_test.go
Outdated
Expect(listObj.Items).NotTo(BeEmpty()) | ||
Expect(listObj.Items).Should(HaveLen(3)) | ||
for _, p := range listObj.Items { | ||
Expect(p.GroupVersionKind().Empty()).To(BeFalse()) |
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 should test that we list the right gvk (the corev1
package should have the package group-version as a package-level variable)
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.
Done.
Is this good to merge now? |
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.
minor nit
pkg/cache/cache_test.go
Outdated
for _, p := range listObj.Items { | ||
Expect(p.GroupVersionKind().Group).To(Equal(kcorev1.SchemeGroupVersion.Group)) | ||
Expect(p.GroupVersionKind().Version).To(Equal(kcorev1.SchemeGroupVersion.Version)) | ||
Expect(p.GroupVersionKind().Kind).To(Equal("Pod")) |
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.
Expect(p.GroupVersionKind()).To(Equal(kcorev1.SchemeGroupVersion.WithKind("Pod")))
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.
Done.
Looks good. Please squash the commits into logical commits (i.e. no "address comments" commits), and I'll merge. |
@liyinan926 think you could rebase this pr? |
@liyinan926 do you think that you can rebase this PR? |
Just run into this issue, @liyinan926 have you time to fix the conflicts and rebase the PR? Happy to pick this up if you don't |
This is blocking me on a project so I've rebased the branch so that I can continue, let me know if you'd like me to open a PR to superseed this one https://github.com/pusher/controller-runtime/tree/list-gvk I found an issue with the tests in which the length of the list can be three or four depending on which cache type we are using. For now I've added a |
I've also just had to push a change to |
@JoelSpeed go ahead and pick this up, and just credit @liyinan926 / keep them as an author on the commit. |
@DirectXMan12 / @liyinan926 I've opened #389 from my branch keeping original commit authorship to credit @liyinan926 |
closing this since these changes by pull in a separate PR #389 |
Fixes #284. Populates
GroupVersionKind
for objects returned by theList
method.