-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use an Informer to list LimitRanges 🥼 #4234
Conversation
069745c
to
71b49ab
Compare
The following is the coverage report on the affected files.
|
71b49ab
to
5002741
Compare
The following is the coverage report on the affected files.
|
I am missing something very obvious in the unit tests.. but.. for some reason I don't see 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.
/approve
5002741
to
b1375f4
Compare
The following is the coverage report on the affected files.
|
b1375f4
to
db91367
Compare
The following is the coverage report on the affected files.
|
db91367
to
38384ac
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: imjasonh, sbwsg 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.
Thanks for this!
/lgtm
) | ||
|
||
func getVirtualLimitRange(ctx context.Context, namespace string, c kubernetes.Interface) (*corev1.LimitRange, error) { | ||
limitRanges, err := c.CoreV1().LimitRanges(namespace).List(ctx, metav1.ListOptions{}) | ||
limitrangeInformer := limitrangeinformer.Get(ctx) |
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.
@imjasonh poked me that this PR was having trouble with the injection stuff. I'm guessing it's because this typically gets the context passed to ReconcileKind
, which is NOT infused with clients and informers.
To echo my other comment, generally you would grab this off of the context passed to NewController
and stash it in a field, to avoid the more "expensive" access during each reconciliation.
TBH I've debated infusing this context with things as well in the past, but until now hadn't really seen a place where it caused confusion. I think allowing that's sort of a mixed bag, and would be hard to walk back, but if you'd like to discuss it I'm open to chatting.
.... but hopefully knowing this at least unblocks you. If not, feel free to ping me!
/hold |
9108729
to
183111f
Compare
/hold cancel |
The following is the coverage report on the affected files.
|
} | ||
} | ||
kubeclient.ClearActions() | ||
return ctx, limitRangeInformer, cancel |
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.
Could consumers just use fakelimitrangeinformer.Get(ctx)
instead of returning it here?
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.
c'est pas faux 😝
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.
c'est pas faux stuck_out_tongue_closed_eyes
Man I am tired.. "c'est pas faux" means "it's not wrong".. speaking in french while commenting.. makes this.. 😅
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
This LGTM, just a nit about setup
if you want to preserve the signature.
/hold In case you want to do the nit, otherwise feel free to remove |
Using a LimitRange lister here instead, so this doesn't end up hitting the real API server on each call. Taking into account a review : tektoncd#4176 (comment). Signed-off-by: Vincent Demeester <[email protected]>
183111f
to
9cd860b
Compare
The following is the coverage report on the affected files.
|
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
/hold cancel
Changes
Using a LimitRange lister here instead, so this doesn't end up hitting
the real API server on each call.
Taking into account a review :
#4176 (comment).
Signed-off-by: Vincent Demeester [email protected]
/kind cleanup
/cc @imjasonh @bobcatfish @pritidesai @sbwsg @afrittoli
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes