Skip to content

Commit 754026b

Browse files
author
James Munnelly
committedMar 26, 2020
Bump dependencies for Kubernetes v1.18.0
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>
1 parent 734df2a commit 754026b

File tree

13 files changed

+275
-299
lines changed

13 files changed

+275
-299
lines changed
 

‎go.mod

+8-10
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,18 @@ require (
1212
github.com/onsi/ginkgo v1.11.0
1313
github.com/onsi/gomega v1.8.1
1414
github.com/prometheus/client_golang v1.0.0
15-
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
15+
github.com/prometheus/client_model v0.2.0
1616
github.com/spf13/pflag v1.0.5
17+
go.uber.org/atomic v1.4.0 // indirect
1718
go.uber.org/zap v1.10.0
18-
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
19-
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 // indirect
2019
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
2120
gomodules.xyz/jsonpatch/v2 v2.0.1
2221
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
2322
gopkg.in/fsnotify.v1 v1.4.7
24-
gopkg.in/yaml.v2 v2.2.7 // indirect
25-
k8s.io/api v0.17.2
26-
k8s.io/apiextensions-apiserver v0.17.2
27-
k8s.io/apimachinery v0.17.2
28-
k8s.io/client-go v0.17.2
29-
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f
30-
sigs.k8s.io/yaml v1.1.0
23+
k8s.io/api v0.18.0
24+
k8s.io/apiextensions-apiserver v0.18.0
25+
k8s.io/apimachinery v0.18.0
26+
k8s.io/client-go v0.18.0
27+
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
28+
sigs.k8s.io/yaml v1.2.0
3129
)

‎go.sum

+46-57
Large diffs are not rendered by default.

‎pkg/cache/internal/informers_map.go

+12-6
Original file line numberDiff line numberDiff line change
@@ -245,20 +245,23 @@ func createStructuredListWatch(gvk schema.GroupVersionKind, ip *specificInformer
245245
return nil, err
246246
}
247247

248+
// TODO: the functions that make use of this ListWatch should be adapted to
249+
// pass in their own contexts instead of relying on this fixed one here.
250+
ctx := context.TODO()
248251
// Create a new ListWatch for the obj
249252
return &cache.ListWatch{
250253
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
251254
res := listObj.DeepCopyObject()
252255
isNamespaceScoped := ip.namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot
253-
err := client.Get().NamespaceIfScoped(ip.namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Do().Into(res)
256+
err := client.Get().NamespaceIfScoped(ip.namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Do(ctx).Into(res)
254257
return res, err
255258
},
256259
// Setup the watch function
257260
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
258261
// Watch needs to be set to true separately
259262
opts.Watch = true
260263
isNamespaceScoped := ip.namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot
261-
return client.Get().NamespaceIfScoped(ip.namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Watch()
264+
return client.Get().NamespaceIfScoped(ip.namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Watch(ctx)
262265
},
263266
}, nil
264267
}
@@ -275,22 +278,25 @@ func createUnstructuredListWatch(gvk schema.GroupVersionKind, ip *specificInform
275278
return nil, err
276279
}
277280

281+
// TODO: the functions that make use of this ListWatch should be adapted to
282+
// pass in their own contexts instead of relying on this fixed one here.
283+
ctx := context.TODO()
278284
// Create a new ListWatch for the obj
279285
return &cache.ListWatch{
280286
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
281287
if ip.namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot {
282-
return dynamicClient.Resource(mapping.Resource).Namespace(ip.namespace).List(opts)
288+
return dynamicClient.Resource(mapping.Resource).Namespace(ip.namespace).List(ctx, opts)
283289
}
284-
return dynamicClient.Resource(mapping.Resource).List(opts)
290+
return dynamicClient.Resource(mapping.Resource).List(ctx, opts)
285291
},
286292
// Setup the watch function
287293
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
288294
// Watch needs to be set to true separately
289295
opts.Watch = true
290296
if ip.namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot {
291-
return dynamicClient.Resource(mapping.Resource).Namespace(ip.namespace).Watch(opts)
297+
return dynamicClient.Resource(mapping.Resource).Namespace(ip.namespace).Watch(ctx, opts)
292298
}
293-
return dynamicClient.Resource(mapping.Resource).Watch(opts)
299+
return dynamicClient.Resource(mapping.Resource).Watch(ctx, opts)
294300
},
295301
}, nil
296302
}

0 commit comments

Comments
 (0)