-
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
🐛 fix labels list option in fake client #311
🐛 fix labels list option in fake client #311
Conversation
I'd put this under |
otherwise LGTM |
@DirectXMan12 thanks for looking at this. You're right, I also renamed the package name from |
Looks good. Just squash the commits and I'll merge (our policy is to have "logical" commits at the end, where each commit describes a distinct piece of functionality) |
Sure! |
83d6010
to
bc400f2
Compare
hmm... did you pull in an extra commit there? |
This commit allows passing label matches to the fake client List() function. This is done in a way similar to the CachedReader. Both now share a common call to `objectutil.FilterWithLabels`. Signed-off-by: sebgl <contact.sebgl@gmail.com>
bc400f2
to
e9c5505
Compare
Yes, my bad, I just rebased and pushed again. Looks better now :) |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12, sebgl 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 |
The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
… under the fake client The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
… under the fake client The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
… under the fake client The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
… under the fake client The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
… under the fake client The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
… under the fake client The relevant PR(kubernetes-sigs/controller-runtime#311) under the controller-runtime already merged, but the whole controller-runtime master code depends on the newer k8s version that currently prevent from us to use it.
This tests a statefulset list with an additional pod that does not belong to the sset and check it is not returned. This was blocked while the fake client did not support label list options. (See kubernetes-sigs/controller-runtime#311)
Speed up tests by caching deps
This commit allows passing label matches to the fake client
List()
function.This feature was not working properly before (no filters applied at all).
This is done in a way similar to the
CachedReader
. Both now share a common call tolistutil.FilterWithLabels
.One thing worth discussing:
I wasn't sure where to extract this common function in the package hierarchy. Keeping it in
cache/internal
does not work since the fake client cannot use a package namedinternal
. Looking at other packages I could not find the right place for it.Hence the new
cache/listutil
package. It still feels a bit wrong, suggestions for a new location are very welcome!Partial fix for #293.