You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently the sdk is using controller-runtimev0.1.10, which does not support LabelSelector filter in fakeClient List func, only support Namespace filter
func (c*fakeClient) List(ctx context.Context, opts*client.ListOptions, list runtime.Object) error {
gvk, err:=getGVKFromList(list, c.scheme)
iferr!=nil {
// The old fake client required GVK info in Raw.TypeMeta, so check there// before giving upifopts.Raw==nil||opts.Raw.TypeMeta.APIVersion==""||opts.Raw.TypeMeta.Kind=="" {
returnerr
}
gvk=opts.Raw.TypeMeta.GroupVersionKind()
}
gvr, _:=meta.UnsafeGuessKindToResource(gvk)
o, err:=c.tracker.List(gvr, gvk, opts.Namespace)
iferr!=nil {
returnerr
}
j, err:=json.Marshal(o)
iferr!=nil {
returnerr
}
decoder:=scheme.Codecs.UniversalDecoder()
_, _, err=decoder.Decode(j, nil, list)
iferr!=nil {
returnerr
}
**ifopts.LabelSelector!=nil {
returnfilterListItems(list, opts.LabelSelector)
}**returnnil
}
I am willing to help submitting a PR for this upgrade if required, thanks
The text was updated successfully, but these errors were encountered:
andy2046
changed the title
upgrade controller-runtime version to support LabelSelector in fakeClient List func
upgrade controller-runtime to support LabelSelector in fakeClient List func
Jun 27, 2019
@andy2046 We are already in the middle of upgrading to controller-runtime v0.2.0 in PR #1512 We are blocked until controller-runtime releases a stable v0.2.0 release.
here I request to upgrade to at least v0.1.11 to support the LabelSelector in fakeClient List
I guess depending on when the v0.2.0 release will happen, bumping to v0.1.11 would be good to do. cc @estroz@camilamacedo86@joelanford What do you think?
@lilic0.1.12 was actually released last week, so if we are going to bump to a 0.1.x version, we should shoot for that.
If it's just a matter of bumping that version (and the Kubernetes version) in our deps, and none of the function signatures we use in our scaffolds change, then we can probably go ahead and do this since 0.2.0 isn't released yet.
Feature Request
Is your feature request related to a problem? Please describe.
Currently the sdk is using
controller-runtime
v0.1.10
, which does not support LabelSelector filter in fakeClient List func, only support Namespace filteroperator-sdk/Gopkg.toml
Lines 33 to 35 in 3cf985d
https://github.com/kubernetes-sigs/controller-runtime/blob/12d98582e72927b6cd0123e2b4e819f9341ce62c/pkg/client/fake/client.go#L91-L114
Describe the solution you'd like
here I request to upgrade to at least
v0.1.11
to support the LabelSelector in fakeClient Listhttps://github.com/kubernetes-sigs/controller-runtime/blob/477bf4f046c31c351b46fa00262bc814ac0bbca1/pkg/client/fake/client.go#L93-L123
I am willing to help submitting a PR for this upgrade if required, thanks
The text was updated successfully, but these errors were encountered: