Skip to content

Commit 3738249

Browse files
committed
Merge branch 'master' into k8s-1.15.3
2 parents 18b1edf + 43a3cd8 commit 3738249

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require (
2929
k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d
3030
k8s.io/client-go v0.0.0-20190918200256-06eb1244587a
3131
k8s.io/klog v0.3.3 // indirect
32-
k8s.io/utils v0.0.0-20190221042446-c2654d5206da
32+
k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5
3333
sigs.k8s.io/testing_frameworks v0.1.1
3434
sigs.k8s.io/yaml v1.1.0
3535
)

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
154154
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
155155
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
156156
github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
157+
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
157158
github.com/spf13/cobra v0.0.0-20180319062004-c439c4fa0937/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
158159
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
159160
github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc=
@@ -252,13 +253,16 @@ k8s.io/client-go v0.0.0-20190918200256-06eb1244587a/go.mod h1:3YAcTbI2ArBRmhHns5
252253
k8s.io/code-generator v0.0.0-20190612205613-18da4a14b22b/go.mod h1:G8bQwmHm2eafm5bgtX67XDZQ8CWKSGu9DekI+yN4Y5I=
253254
k8s.io/component-base v0.0.0-20190918200425-ed2f0867c778/go.mod h1:DFWQCXgXVLiWtzFaS17KxHdlUeUymP7FLxZSkmL9/jU=
254255
k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
256+
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
255257
k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
256258
k8s.io/klog v0.3.3 h1:niceAagH1tzskmaie/icWd7ci1wbG7Bf2c6YGcQv+3c=
257259
k8s.io/klog v0.3.3/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
258260
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI=
259261
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
260262
k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn3b/WPHqD5mBvP4=
261263
k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0=
264+
k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5 h1:VBM/0P5TWxwk+Nw6Z+lAw3DKgO76g90ETOiA6rfLV1Y=
265+
k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
262266
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
263267
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
264268
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=

pkg/cache/internal/cache_reader.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"k8s.io/apimachinery/pkg/selection"
3131
"k8s.io/client-go/tools/cache"
3232
"sigs.k8s.io/controller-runtime/pkg/client"
33-
"sigs.k8s.io/controller-runtime/pkg/internal/objectutil"
3433
)
3534

3635
// CacheReader is a CacheReader
@@ -125,15 +124,22 @@ func (c *CacheReader) List(_ context.Context, out runtime.Object, opts ...client
125124
if !isObj {
126125
return fmt.Errorf("cache contained %T, which is not an Object", obj)
127126
}
127+
meta, err := apimeta.Accessor(obj)
128+
if err != nil {
129+
return err
130+
}
131+
if labelSel != nil {
132+
lbls := labels.Set(meta.GetLabels())
133+
if !labelSel.Matches(lbls) {
134+
continue
135+
}
136+
}
137+
128138
outObj := obj.DeepCopyObject()
129139
outObj.GetObjectKind().SetGroupVersionKind(c.groupVersionKind)
130140
runtimeObjs = append(runtimeObjs, outObj)
131141
}
132-
filteredItems, err := objectutil.FilterWithLabels(runtimeObjs, labelSel)
133-
if err != nil {
134-
return err
135-
}
136-
return apimeta.SetList(out, filteredItems)
142+
return apimeta.SetList(out, runtimeObjs)
137143
}
138144

139145
// objectKeyToStorageKey converts an object key to store key.

pkg/client/apiutil/apimachinery.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ import (
3535
// information fetched by a new client with the given config.
3636
func NewDiscoveryRESTMapper(c *rest.Config) (meta.RESTMapper, error) {
3737
// Get a mapper
38-
dc := discovery.NewDiscoveryClientForConfigOrDie(c)
38+
dc, err := discovery.NewDiscoveryClientForConfig(c)
39+
if err != nil {
40+
return nil, err
41+
}
3942
gr, err := restmapper.GetAPIGroupResources(dc)
4043
if err != nil {
4144
return nil, err

0 commit comments

Comments
 (0)