From 8692d260f8332158d84dc62998476aab6bfbbb8a Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Fri, 25 Dec 2015 18:05:18 -0500 Subject: [PATCH] Use Parameter codec in request.VersionedParams() --- .../generators/generator-for-group.go | 4 ++-- .../generators/generator-for-type.go | 23 ++++++++++--------- .../testgroup/unversioned/testtype.go | 6 ++--- pkg/client/cache/listwatch.go | 4 ++-- .../extensions/unversioned/daemonset.go | 6 ++--- .../extensions/unversioned/deployment.go | 6 ++--- .../unversioned/horizontalpodautoscaler.go | 6 ++--- .../extensions/unversioned/ingress.go | 6 ++--- .../generated/extensions/unversioned/job.go | 6 ++--- .../unversioned/thirdpartyresource.go | 6 ++--- .../legacy/unversioned/componentstatus.go | 6 ++--- .../generated/legacy/unversioned/endpoints.go | 6 ++--- .../generated/legacy/unversioned/event.go | 6 ++--- .../legacy/unversioned/limitrange.go | 6 ++--- .../generated/legacy/unversioned/namespace.go | 6 ++--- .../generated/legacy/unversioned/node.go | 6 ++--- .../legacy/unversioned/persistentvolume.go | 6 ++--- .../unversioned/persistentvolumeclaim.go | 6 ++--- .../typed/generated/legacy/unversioned/pod.go | 6 ++--- .../legacy/unversioned/pod_expansion.go | 2 +- .../legacy/unversioned/podtemplate.go | 6 ++--- .../unversioned/replicationcontroller.go | 6 ++--- .../legacy/unversioned/resourcequota.go | 6 ++--- .../generated/legacy/unversioned/secret.go | 6 ++--- .../generated/legacy/unversioned/service.go | 6 ++--- .../legacy/unversioned/serviceaccount.go | 6 ++--- pkg/client/unversioned/componentstatuses.go | 2 +- pkg/client/unversioned/configmap.go | 4 ++-- pkg/client/unversioned/daemon_sets.go | 4 ++-- pkg/client/unversioned/deployment.go | 4 ++-- pkg/client/unversioned/endpoints.go | 4 ++-- pkg/client/unversioned/events.go | 6 ++--- .../unversioned/horizontalpodautoscaler.go | 4 ++-- pkg/client/unversioned/ingress.go | 4 ++-- pkg/client/unversioned/jobs.go | 4 ++-- pkg/client/unversioned/limit_ranges.go | 4 ++-- pkg/client/unversioned/namespaces.go | 4 ++-- pkg/client/unversioned/nodes.go | 4 ++-- .../unversioned/persistentvolumeclaim.go | 4 ++-- pkg/client/unversioned/persistentvolumes.go | 4 ++-- pkg/client/unversioned/pod_templates.go | 4 ++-- pkg/client/unversioned/pods.go | 6 ++--- pkg/client/unversioned/replica_sets.go | 4 ++-- .../unversioned/replication_controllers.go | 4 ++-- pkg/client/unversioned/request.go | 12 +++------- pkg/client/unversioned/request_test.go | 6 ++--- pkg/client/unversioned/resource_quotas.go | 4 ++-- pkg/client/unversioned/secrets.go | 4 ++-- pkg/client/unversioned/service_accounts.go | 4 ++-- pkg/client/unversioned/services.go | 4 ++-- pkg/client/unversioned/thirdpartyresources.go | 4 ++-- pkg/kubectl/cmd/attach.go | 2 +- pkg/kubectl/cmd/exec.go | 2 +- 53 files changed, 138 insertions(+), 143 deletions(-) diff --git a/cmd/libs/go2idl/client-gen/generators/generator-for-group.go b/cmd/libs/go2idl/client-gen/generators/generator-for-group.go index 75b3edc51ea..d3baa34582f 100644 --- a/cmd/libs/go2idl/client-gen/generators/generator-for-group.go +++ b/cmd/libs/go2idl/client-gen/generators/generator-for-group.go @@ -82,7 +82,7 @@ func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer "latestGroup": c.Universe.Variable(types.Name{Package: pkgRegistered, Name: "Group"}), "GroupOrDie": c.Universe.Variable(types.Name{Package: pkgRegistered, Name: "GroupOrDie"}), "apiPath": apiPath(g.group), - "latestCodecs": c.Universe.Variable(types.Name{Package: pkgAPI, Name: "Codecs"}), + "codecs": c.Universe.Variable(types.Name{Package: pkgAPI, Name: "Codecs"}), } sw.Do(groupInterfaceTemplate, m) sw.Do(groupClientTemplate, m) @@ -183,7 +183,7 @@ func setConfigDefaults(config *$.Config|raw$) error { config.GroupVersion = ©GroupVersion //} - config.Codec = $.latestCodecs|raw$.LegacyCodec(*config.GroupVersion) + config.Codec = $.codecs|raw$.LegacyCodec(*config.GroupVersion) if config.QPS == 0 { config.QPS = 5 } diff --git a/cmd/libs/go2idl/client-gen/generators/generator-for-type.go b/cmd/libs/go2idl/client-gen/generators/generator-for-type.go index bc859a1c732..09c2f2d68d8 100644 --- a/cmd/libs/go2idl/client-gen/generators/generator-for-type.go +++ b/cmd/libs/go2idl/client-gen/generators/generator-for-type.go @@ -68,14 +68,15 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i pkg := filepath.Base(t.Name.Package) namespaced := !(types.ExtractCommentTags("+", t.SecondClosestCommentLines)["nonNamespaced"] == "true") m := map[string]interface{}{ - "type": t, - "package": pkg, - "Package": namer.IC(pkg), - "Group": namer.IC(g.group), - "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/watch", Name: "Interface"}), - "apiDeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "DeleteOptions"}), - "apiListOptions": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "ListOptions"}), - "namespaced": namespaced, + "type": t, + "package": pkg, + "Package": namer.IC(pkg), + "Group": namer.IC(g.group), + "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/watch", Name: "Interface"}), + "apiDeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "DeleteOptions"}), + "apiListOptions": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "ListOptions"}), + "apiParameterCodec": c.Universe.Type(types.Name{Package: "k8s.io/kubernetes/pkg/api", Name: "ParameterCodec"}), + "namespaced": namespaced, } sw.Do(getterComment, m) @@ -207,7 +208,7 @@ func (c *$.type|privatePlural$) List(opts $.apiListOptions|raw$) (result *$.type err = c.client.Get(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|allLowercasePlural$"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, $.apiParameterCodec|raw$). Do(). Into(result) return @@ -246,7 +247,7 @@ func (c *$.type|privatePlural$) DeleteCollection(options *$.apiDeleteOptions|raw return c.client.Delete(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|allLowercasePlural$"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, $.apiParameterCodec|raw$). Body(options). Do(). Error() @@ -304,7 +305,7 @@ func (c *$.type|privatePlural$) Watch(opts $.apiListOptions|raw$) ($.watchInterf Prefix("watch"). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|allLowercasePlural$"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, $.apiParameterCodec|raw$). Watch() } ` diff --git a/cmd/libs/go2idl/client-gen/testoutput/testgroup/unversioned/testtype.go b/cmd/libs/go2idl/client-gen/testoutput/testgroup/unversioned/testtype.go index f212ad217ea..ec735a4e379 100644 --- a/cmd/libs/go2idl/client-gen/testoutput/testgroup/unversioned/testtype.go +++ b/cmd/libs/go2idl/client-gen/testoutput/testgroup/unversioned/testtype.go @@ -109,7 +109,7 @@ func (c *testTypes) DeleteCollection(options *api.DeleteOptions, listOptions api return c.client.Delete(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -133,7 +133,7 @@ func (c *testTypes) List(opts api.ListOptions) (result *testgroup.TestTypeList, err = c.client.Get(). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -145,6 +145,6 @@ func (c *testTypes) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("testtypes"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/cache/listwatch.go b/pkg/client/cache/listwatch.go index 20c3db5ea44..18528d23652 100644 --- a/pkg/client/cache/listwatch.go +++ b/pkg/client/cache/listwatch.go @@ -51,7 +51,7 @@ func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSe return c.Get(). Namespace(namespace). Resource(resource). - VersionedParams(&options, api.Scheme). + VersionedParams(&options, api.ParameterCodec). FieldsSelectorParam(fieldSelector). Do(). Get() @@ -61,7 +61,7 @@ func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSe Prefix("watch"). Namespace(namespace). Resource(resource). - VersionedParams(&options, api.Scheme). + VersionedParams(&options, api.ParameterCodec). FieldsSelectorParam(fieldSelector). Watch() } diff --git a/pkg/client/typed/generated/extensions/unversioned/daemonset.go b/pkg/client/typed/generated/extensions/unversioned/daemonset.go index d76de635b76..96dae5835a2 100644 --- a/pkg/client/typed/generated/extensions/unversioned/daemonset.go +++ b/pkg/client/typed/generated/extensions/unversioned/daemonset.go @@ -109,7 +109,7 @@ func (c *daemonSets) DeleteCollection(options *api.DeleteOptions, listOptions ap return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -133,7 +133,7 @@ func (c *daemonSets) List(opts api.ListOptions) (result *extensions.DaemonSetLis err = c.client.Get(). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -145,6 +145,6 @@ func (c *daemonSets) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/extensions/unversioned/deployment.go b/pkg/client/typed/generated/extensions/unversioned/deployment.go index df9dc1c43ab..3b995c02161 100644 --- a/pkg/client/typed/generated/extensions/unversioned/deployment.go +++ b/pkg/client/typed/generated/extensions/unversioned/deployment.go @@ -109,7 +109,7 @@ func (c *deployments) DeleteCollection(options *api.DeleteOptions, listOptions a return c.client.Delete(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -133,7 +133,7 @@ func (c *deployments) List(opts api.ListOptions) (result *extensions.DeploymentL err = c.client.Get(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -145,6 +145,6 @@ func (c *deployments) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("deployments"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/extensions/unversioned/horizontalpodautoscaler.go b/pkg/client/typed/generated/extensions/unversioned/horizontalpodautoscaler.go index 78424854282..2cffcee4656 100644 --- a/pkg/client/typed/generated/extensions/unversioned/horizontalpodautoscaler.go +++ b/pkg/client/typed/generated/extensions/unversioned/horizontalpodautoscaler.go @@ -109,7 +109,7 @@ func (c *horizontalPodAutoscalers) DeleteCollection(options *api.DeleteOptions, return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -133,7 +133,7 @@ func (c *horizontalPodAutoscalers) List(opts api.ListOptions) (result *extension err = c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -145,6 +145,6 @@ func (c *horizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, Prefix("watch"). Namespace(c.ns). Resource("horizontalpodautoscalers"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/extensions/unversioned/ingress.go b/pkg/client/typed/generated/extensions/unversioned/ingress.go index c2daa3e5f10..a9d950eae89 100644 --- a/pkg/client/typed/generated/extensions/unversioned/ingress.go +++ b/pkg/client/typed/generated/extensions/unversioned/ingress.go @@ -109,7 +109,7 @@ func (c *ingresses) DeleteCollection(options *api.DeleteOptions, listOptions api return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -133,7 +133,7 @@ func (c *ingresses) List(opts api.ListOptions) (result *extensions.IngressList, err = c.client.Get(). Namespace(c.ns). Resource("ingresses"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -145,6 +145,6 @@ func (c *ingresses) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("ingresses"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/extensions/unversioned/job.go b/pkg/client/typed/generated/extensions/unversioned/job.go index 5e6cf7f33f8..04d0d128235 100644 --- a/pkg/client/typed/generated/extensions/unversioned/job.go +++ b/pkg/client/typed/generated/extensions/unversioned/job.go @@ -109,7 +109,7 @@ func (c *jobs) DeleteCollection(options *api.DeleteOptions, listOptions api.List return c.client.Delete(). Namespace(c.ns). Resource("jobs"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -133,7 +133,7 @@ func (c *jobs) List(opts api.ListOptions) (result *extensions.JobList, err error err = c.client.Get(). Namespace(c.ns). Resource("jobs"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -145,6 +145,6 @@ func (c *jobs) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("jobs"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/extensions/unversioned/thirdpartyresource.go b/pkg/client/typed/generated/extensions/unversioned/thirdpartyresource.go index 2b645e71189..0f1026fab52 100644 --- a/pkg/client/typed/generated/extensions/unversioned/thirdpartyresource.go +++ b/pkg/client/typed/generated/extensions/unversioned/thirdpartyresource.go @@ -95,7 +95,7 @@ func (c *thirdPartyResources) DeleteCollection(options *api.DeleteOptions, listO return c.client.Delete(). Namespace(c.ns). Resource("thirdpartyresources"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -119,7 +119,7 @@ func (c *thirdPartyResources) List(opts api.ListOptions) (result *extensions.Thi err = c.client.Get(). Namespace(c.ns). Resource("thirdpartyresources"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -131,6 +131,6 @@ func (c *thirdPartyResources) Watch(opts api.ListOptions) (watch.Interface, erro Prefix("watch"). Namespace(c.ns). Resource("thirdpartyresources"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/componentstatus.go b/pkg/client/typed/generated/legacy/unversioned/componentstatus.go index dfff6224385..06484f7f4ae 100644 --- a/pkg/client/typed/generated/legacy/unversioned/componentstatus.go +++ b/pkg/client/typed/generated/legacy/unversioned/componentstatus.go @@ -88,7 +88,7 @@ func (c *componentStatuses) Delete(name string, options *api.DeleteOptions) erro func (c *componentStatuses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { return c.client.Delete(). Resource("componentstatuses"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -110,7 +110,7 @@ func (c *componentStatuses) List(opts api.ListOptions) (result *api.ComponentSta result = &api.ComponentStatusList{} err = c.client.Get(). Resource("componentstatuses"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -121,6 +121,6 @@ func (c *componentStatuses) Watch(opts api.ListOptions) (watch.Interface, error) return c.client.Get(). Prefix("watch"). Resource("componentstatuses"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/endpoints.go b/pkg/client/typed/generated/legacy/unversioned/endpoints.go index 0e150fb7fca..1c8c8619b7e 100644 --- a/pkg/client/typed/generated/legacy/unversioned/endpoints.go +++ b/pkg/client/typed/generated/legacy/unversioned/endpoints.go @@ -94,7 +94,7 @@ func (c *endpoints) DeleteCollection(options *api.DeleteOptions, listOptions api return c.client.Delete(). Namespace(c.ns). Resource("endpoints"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -118,7 +118,7 @@ func (c *endpoints) List(opts api.ListOptions) (result *api.EndpointsList, err e err = c.client.Get(). Namespace(c.ns). Resource("endpoints"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -130,6 +130,6 @@ func (c *endpoints) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("endpoints"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/event.go b/pkg/client/typed/generated/legacy/unversioned/event.go index 1cd6bf078af..e411c24ce26 100644 --- a/pkg/client/typed/generated/legacy/unversioned/event.go +++ b/pkg/client/typed/generated/legacy/unversioned/event.go @@ -94,7 +94,7 @@ func (c *events) DeleteCollection(options *api.DeleteOptions, listOptions api.Li return c.client.Delete(). Namespace(c.ns). Resource("events"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -118,7 +118,7 @@ func (c *events) List(opts api.ListOptions) (result *api.EventList, err error) { err = c.client.Get(). Namespace(c.ns). Resource("events"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -130,6 +130,6 @@ func (c *events) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("events"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/limitrange.go b/pkg/client/typed/generated/legacy/unversioned/limitrange.go index 8f4dc9afcff..d13c745189d 100644 --- a/pkg/client/typed/generated/legacy/unversioned/limitrange.go +++ b/pkg/client/typed/generated/legacy/unversioned/limitrange.go @@ -94,7 +94,7 @@ func (c *limitRanges) DeleteCollection(options *api.DeleteOptions, listOptions a return c.client.Delete(). Namespace(c.ns). Resource("limitranges"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -118,7 +118,7 @@ func (c *limitRanges) List(opts api.ListOptions) (result *api.LimitRangeList, er err = c.client.Get(). Namespace(c.ns). Resource("limitranges"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -130,6 +130,6 @@ func (c *limitRanges) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("limitranges"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/namespace.go b/pkg/client/typed/generated/legacy/unversioned/namespace.go index 733f753f3fe..b95f9638276 100644 --- a/pkg/client/typed/generated/legacy/unversioned/namespace.go +++ b/pkg/client/typed/generated/legacy/unversioned/namespace.go @@ -101,7 +101,7 @@ func (c *namespaces) Delete(name string, options *api.DeleteOptions) error { func (c *namespaces) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { return c.client.Delete(). Resource("namespaces"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -123,7 +123,7 @@ func (c *namespaces) List(opts api.ListOptions) (result *api.NamespaceList, err result = &api.NamespaceList{} err = c.client.Get(). Resource("namespaces"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -134,6 +134,6 @@ func (c *namespaces) Watch(opts api.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Resource("namespaces"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/node.go b/pkg/client/typed/generated/legacy/unversioned/node.go index 37c087a9c16..e6b6537437c 100644 --- a/pkg/client/typed/generated/legacy/unversioned/node.go +++ b/pkg/client/typed/generated/legacy/unversioned/node.go @@ -101,7 +101,7 @@ func (c *nodes) Delete(name string, options *api.DeleteOptions) error { func (c *nodes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { return c.client.Delete(). Resource("nodes"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -123,7 +123,7 @@ func (c *nodes) List(opts api.ListOptions) (result *api.NodeList, err error) { result = &api.NodeList{} err = c.client.Get(). Resource("nodes"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -134,6 +134,6 @@ func (c *nodes) Watch(opts api.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Resource("nodes"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/persistentvolume.go b/pkg/client/typed/generated/legacy/unversioned/persistentvolume.go index 2595b2eeb35..1cf23caceeb 100644 --- a/pkg/client/typed/generated/legacy/unversioned/persistentvolume.go +++ b/pkg/client/typed/generated/legacy/unversioned/persistentvolume.go @@ -101,7 +101,7 @@ func (c *persistentVolumes) Delete(name string, options *api.DeleteOptions) erro func (c *persistentVolumes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { return c.client.Delete(). Resource("persistentvolumes"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -123,7 +123,7 @@ func (c *persistentVolumes) List(opts api.ListOptions) (result *api.PersistentVo result = &api.PersistentVolumeList{} err = c.client.Get(). Resource("persistentvolumes"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -134,6 +134,6 @@ func (c *persistentVolumes) Watch(opts api.ListOptions) (watch.Interface, error) return c.client.Get(). Prefix("watch"). Resource("persistentvolumes"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/persistentvolumeclaim.go b/pkg/client/typed/generated/legacy/unversioned/persistentvolumeclaim.go index e775cb3c64f..8d807204395 100644 --- a/pkg/client/typed/generated/legacy/unversioned/persistentvolumeclaim.go +++ b/pkg/client/typed/generated/legacy/unversioned/persistentvolumeclaim.go @@ -108,7 +108,7 @@ func (c *persistentVolumeClaims) DeleteCollection(options *api.DeleteOptions, li return c.client.Delete(). Namespace(c.ns). Resource("persistentvolumeclaims"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -132,7 +132,7 @@ func (c *persistentVolumeClaims) List(opts api.ListOptions) (result *api.Persist err = c.client.Get(). Namespace(c.ns). Resource("persistentvolumeclaims"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -144,6 +144,6 @@ func (c *persistentVolumeClaims) Watch(opts api.ListOptions) (watch.Interface, e Prefix("watch"). Namespace(c.ns). Resource("persistentvolumeclaims"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/pod.go b/pkg/client/typed/generated/legacy/unversioned/pod.go index a5e34218a64..30e6f059d07 100644 --- a/pkg/client/typed/generated/legacy/unversioned/pod.go +++ b/pkg/client/typed/generated/legacy/unversioned/pod.go @@ -108,7 +108,7 @@ func (c *pods) DeleteCollection(options *api.DeleteOptions, listOptions api.List return c.client.Delete(). Namespace(c.ns). Resource("pods"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -132,7 +132,7 @@ func (c *pods) List(opts api.ListOptions) (result *api.PodList, err error) { err = c.client.Get(). Namespace(c.ns). Resource("pods"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -144,6 +144,6 @@ func (c *pods) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("pods"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/pod_expansion.go b/pkg/client/typed/generated/legacy/unversioned/pod_expansion.go index c2019a4bff1..e14b83882f8 100644 --- a/pkg/client/typed/generated/legacy/unversioned/pod_expansion.go +++ b/pkg/client/typed/generated/legacy/unversioned/pod_expansion.go @@ -33,5 +33,5 @@ func (c *pods) Bind(binding *api.Binding) error { // Get constructs a request for getting the logs for a pod func (c *pods) GetLogs(name string, opts *api.PodLogOptions) *unversioned.Request { - return c.client.Get().Namespace(c.ns).Name(name).Resource("pods").SubResource("log").VersionedParams(opts, api.Scheme) + return c.client.Get().Namespace(c.ns).Name(name).Resource("pods").SubResource("log").VersionedParams(opts, api.ParameterCodec) } diff --git a/pkg/client/typed/generated/legacy/unversioned/podtemplate.go b/pkg/client/typed/generated/legacy/unversioned/podtemplate.go index 8a18cf7236c..eebfedbaaae 100644 --- a/pkg/client/typed/generated/legacy/unversioned/podtemplate.go +++ b/pkg/client/typed/generated/legacy/unversioned/podtemplate.go @@ -94,7 +94,7 @@ func (c *podTemplates) DeleteCollection(options *api.DeleteOptions, listOptions return c.client.Delete(). Namespace(c.ns). Resource("podtemplates"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -118,7 +118,7 @@ func (c *podTemplates) List(opts api.ListOptions) (result *api.PodTemplateList, err = c.client.Get(). Namespace(c.ns). Resource("podtemplates"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -130,6 +130,6 @@ func (c *podTemplates) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("podtemplates"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/replicationcontroller.go b/pkg/client/typed/generated/legacy/unversioned/replicationcontroller.go index 5881268d056..b5238749a05 100644 --- a/pkg/client/typed/generated/legacy/unversioned/replicationcontroller.go +++ b/pkg/client/typed/generated/legacy/unversioned/replicationcontroller.go @@ -108,7 +108,7 @@ func (c *replicationControllers) DeleteCollection(options *api.DeleteOptions, li return c.client.Delete(). Namespace(c.ns). Resource("replicationcontrollers"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -132,7 +132,7 @@ func (c *replicationControllers) List(opts api.ListOptions) (result *api.Replica err = c.client.Get(). Namespace(c.ns). Resource("replicationcontrollers"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -144,6 +144,6 @@ func (c *replicationControllers) Watch(opts api.ListOptions) (watch.Interface, e Prefix("watch"). Namespace(c.ns). Resource("replicationcontrollers"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/resourcequota.go b/pkg/client/typed/generated/legacy/unversioned/resourcequota.go index 07367f02dfd..750fa1325fc 100644 --- a/pkg/client/typed/generated/legacy/unversioned/resourcequota.go +++ b/pkg/client/typed/generated/legacy/unversioned/resourcequota.go @@ -108,7 +108,7 @@ func (c *resourceQuotas) DeleteCollection(options *api.DeleteOptions, listOption return c.client.Delete(). Namespace(c.ns). Resource("resourcequotas"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -132,7 +132,7 @@ func (c *resourceQuotas) List(opts api.ListOptions) (result *api.ResourceQuotaLi err = c.client.Get(). Namespace(c.ns). Resource("resourcequotas"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -144,6 +144,6 @@ func (c *resourceQuotas) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("resourcequotas"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/secret.go b/pkg/client/typed/generated/legacy/unversioned/secret.go index 4a870981fe0..40096f13e27 100644 --- a/pkg/client/typed/generated/legacy/unversioned/secret.go +++ b/pkg/client/typed/generated/legacy/unversioned/secret.go @@ -94,7 +94,7 @@ func (c *secrets) DeleteCollection(options *api.DeleteOptions, listOptions api.L return c.client.Delete(). Namespace(c.ns). Resource("secrets"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -118,7 +118,7 @@ func (c *secrets) List(opts api.ListOptions) (result *api.SecretList, err error) err = c.client.Get(). Namespace(c.ns). Resource("secrets"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -130,6 +130,6 @@ func (c *secrets) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("secrets"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/service.go b/pkg/client/typed/generated/legacy/unversioned/service.go index db474a79690..809f9e05c7f 100644 --- a/pkg/client/typed/generated/legacy/unversioned/service.go +++ b/pkg/client/typed/generated/legacy/unversioned/service.go @@ -108,7 +108,7 @@ func (c *services) DeleteCollection(options *api.DeleteOptions, listOptions api. return c.client.Delete(). Namespace(c.ns). Resource("services"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -132,7 +132,7 @@ func (c *services) List(opts api.ListOptions) (result *api.ServiceList, err erro err = c.client.Get(). Namespace(c.ns). Resource("services"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -144,6 +144,6 @@ func (c *services) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("services"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/typed/generated/legacy/unversioned/serviceaccount.go b/pkg/client/typed/generated/legacy/unversioned/serviceaccount.go index 6b0a973ed54..6e2d16727e3 100644 --- a/pkg/client/typed/generated/legacy/unversioned/serviceaccount.go +++ b/pkg/client/typed/generated/legacy/unversioned/serviceaccount.go @@ -94,7 +94,7 @@ func (c *serviceAccounts) DeleteCollection(options *api.DeleteOptions, listOptio return c.client.Delete(). Namespace(c.ns). Resource("serviceaccounts"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() @@ -118,7 +118,7 @@ func (c *serviceAccounts) List(opts api.ListOptions) (result *api.ServiceAccount err = c.client.Get(). Namespace(c.ns). Resource("serviceaccounts"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -130,6 +130,6 @@ func (c *serviceAccounts) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("serviceaccounts"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/componentstatuses.go b/pkg/client/unversioned/componentstatuses.go index d63dfda82a9..0717cdec124 100644 --- a/pkg/client/unversioned/componentstatuses.go +++ b/pkg/client/unversioned/componentstatuses.go @@ -46,7 +46,7 @@ func (c *componentStatuses) List(opts api.ListOptions) (result *api.ComponentSta result = &api.ComponentStatusList{} err = c.client.Get(). Resource("componentStatuses"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) diff --git a/pkg/client/unversioned/configmap.go b/pkg/client/unversioned/configmap.go index 3f84745168c..60fffa75579 100644 --- a/pkg/client/unversioned/configmap.go +++ b/pkg/client/unversioned/configmap.go @@ -70,7 +70,7 @@ func (c *ConfigMaps) List(opts api.ListOptions) (*api.ConfigMapList, error) { err := c.client.Get(). Namespace(c.namespace). Resource(ConfigMapResourceName). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) @@ -117,6 +117,6 @@ func (c *ConfigMaps) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.namespace). Resource(ConfigMapResourceName). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/daemon_sets.go b/pkg/client/unversioned/daemon_sets.go index 1aabba69a22..fa12591a658 100644 --- a/pkg/client/unversioned/daemon_sets.go +++ b/pkg/client/unversioned/daemon_sets.go @@ -52,7 +52,7 @@ var _ DaemonSetInterface = &daemonSets{} func (c *daemonSets) List(opts api.ListOptions) (result *extensions.DaemonSetList, err error) { result = &extensions.DaemonSetList{} - err = c.r.Get().Namespace(c.ns).Resource("daemonsets").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.r.Get().Namespace(c.ns).Resource("daemonsets").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -95,6 +95,6 @@ func (c *daemonSets) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/deployment.go b/pkg/client/unversioned/deployment.go index 35b9fa6fc62..b14bc89027a 100644 --- a/pkg/client/unversioned/deployment.go +++ b/pkg/client/unversioned/deployment.go @@ -55,7 +55,7 @@ func newDeployments(c *ExtensionsClient, namespace string) *deployments { // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deployments) List(opts api.ListOptions) (result *extensions.DeploymentList, err error) { result = &extensions.DeploymentList{} - err = c.client.Get().Namespace(c.ns).Resource("deployments").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.client.Get().Namespace(c.ns).Resource("deployments").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -97,6 +97,6 @@ func (c *deployments) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("deployments"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/endpoints.go b/pkg/client/unversioned/endpoints.go index 24993efda23..a5df26c5170 100644 --- a/pkg/client/unversioned/endpoints.go +++ b/pkg/client/unversioned/endpoints.go @@ -62,7 +62,7 @@ func (c *endpoints) List(opts api.ListOptions) (result *api.EndpointsList, err e err = c.r.Get(). Namespace(c.ns). Resource("endpoints"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -86,7 +86,7 @@ func (c *endpoints) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("endpoints"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/events.go b/pkg/client/unversioned/events.go index 2e909319295..882204be693 100644 --- a/pkg/client/unversioned/events.go +++ b/pkg/client/unversioned/events.go @@ -122,7 +122,7 @@ func (e *events) List(opts api.ListOptions) (*api.EventList, error) { err := e.client.Get(). Namespace(e.namespace). Resource("events"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return result, err @@ -146,7 +146,7 @@ func (e *events) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(e.namespace). Resource("events"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } @@ -190,7 +190,7 @@ func (e *events) DeleteCollection(options *api.DeleteOptions, listOptions api.Li return e.client.Delete(). Namespace(e.namespace). Resource("events"). - VersionedParams(&listOptions, api.Scheme). + VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() diff --git a/pkg/client/unversioned/horizontalpodautoscaler.go b/pkg/client/unversioned/horizontalpodautoscaler.go index 722f13ad468..efdf82b70ed 100644 --- a/pkg/client/unversioned/horizontalpodautoscaler.go +++ b/pkg/client/unversioned/horizontalpodautoscaler.go @@ -55,7 +55,7 @@ func newHorizontalPodAutoscalers(c *ExtensionsClient, namespace string) *horizon // List takes label and field selectors, and returns the list of horizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalers) List(opts api.ListOptions) (result *extensions.HorizontalPodAutoscalerList, err error) { result = &extensions.HorizontalPodAutoscalerList{} - err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -98,6 +98,6 @@ func (c *horizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, Prefix("watch"). Namespace(c.ns). Resource("horizontalPodAutoscalers"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/ingress.go b/pkg/client/unversioned/ingress.go index c3825b0dae8..4865b20862f 100644 --- a/pkg/client/unversioned/ingress.go +++ b/pkg/client/unversioned/ingress.go @@ -52,7 +52,7 @@ func newIngress(c *ExtensionsClient, namespace string) *ingress { // List returns a list of ingress that match the label and field selectors. func (c *ingress) List(opts api.ListOptions) (result *extensions.IngressList, err error) { result = &extensions.IngressList{} - err = c.r.Get().Namespace(c.ns).Resource("ingresses").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.r.Get().Namespace(c.ns).Resource("ingresses").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -88,7 +88,7 @@ func (c *ingress) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("ingresses"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/jobs.go b/pkg/client/unversioned/jobs.go index bbc228ea998..0d10997c7a3 100644 --- a/pkg/client/unversioned/jobs.go +++ b/pkg/client/unversioned/jobs.go @@ -55,7 +55,7 @@ var _ JobInterface = &jobs{} // List returns a list of jobs that match the label and field selectors. func (c *jobs) List(opts api.ListOptions) (result *extensions.JobList, err error) { result = &extensions.JobList{} - err = c.r.Get().Namespace(c.ns).Resource("jobs").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.r.Get().Namespace(c.ns).Resource("jobs").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -91,7 +91,7 @@ func (c *jobs) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("jobs"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/limit_ranges.go b/pkg/client/unversioned/limit_ranges.go index 6820e2c22f5..0ed7e2a25f4 100644 --- a/pkg/client/unversioned/limit_ranges.go +++ b/pkg/client/unversioned/limit_ranges.go @@ -55,7 +55,7 @@ func newLimitRanges(c *Client, namespace string) *limitRanges { // List takes a selector, and returns the list of limitRanges that match that selector. func (c *limitRanges) List(opts api.ListOptions) (result *api.LimitRangeList, err error) { result = &api.LimitRangeList{} - err = c.r.Get().Namespace(c.ns).Resource("limitRanges").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.r.Get().Namespace(c.ns).Resource("limitRanges").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -95,6 +95,6 @@ func (c *limitRanges) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("limitRanges"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/namespaces.go b/pkg/client/unversioned/namespaces.go index 9b669f7cd34..c3158d89d5e 100644 --- a/pkg/client/unversioned/namespaces.go +++ b/pkg/client/unversioned/namespaces.go @@ -60,7 +60,7 @@ func (c *namespaces) List(opts api.ListOptions) (*api.NamespaceList, error) { result := &api.NamespaceList{} err := c.r.Get(). Resource("namespaces"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do().Into(result) return result, err } @@ -115,6 +115,6 @@ func (c *namespaces) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Resource("namespaces"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/nodes.go b/pkg/client/unversioned/nodes.go index 12570425de4..1d2990ba684 100644 --- a/pkg/client/unversioned/nodes.go +++ b/pkg/client/unversioned/nodes.go @@ -62,7 +62,7 @@ func (c *nodes) Create(node *api.Node) (*api.Node, error) { // List takes a selector, and returns the list of nodes that match that selector in the cluster. func (c *nodes) List(opts api.ListOptions) (*api.NodeList, error) { result := &api.NodeList{} - err := c.r.Get().Resource(c.resourceName()).VersionedParams(&opts, api.Scheme).Do().Into(result) + err := c.r.Get().Resource(c.resourceName()).VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return result, err } @@ -105,6 +105,6 @@ func (c *nodes) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(api.NamespaceAll). Resource(c.resourceName()). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/persistentvolumeclaim.go b/pkg/client/unversioned/persistentvolumeclaim.go index 4764e42b052..9798e7a29fa 100644 --- a/pkg/client/unversioned/persistentvolumeclaim.go +++ b/pkg/client/unversioned/persistentvolumeclaim.go @@ -56,7 +56,7 @@ func (c *persistentVolumeClaims) List(opts api.ListOptions) (result *api.Persist err = c.client.Get(). Namespace(c.namespace). Resource("persistentVolumeClaims"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) @@ -100,6 +100,6 @@ func (c *persistentVolumeClaims) Watch(opts api.ListOptions) (watch.Interface, e Prefix("watch"). Namespace(c.namespace). Resource("persistentVolumeClaims"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/persistentvolumes.go b/pkg/client/unversioned/persistentvolumes.go index c9f735c8b31..252cc5cf660 100644 --- a/pkg/client/unversioned/persistentvolumes.go +++ b/pkg/client/unversioned/persistentvolumes.go @@ -51,7 +51,7 @@ func (c *persistentVolumes) List(opts api.ListOptions) (result *api.PersistentVo result = &api.PersistentVolumeList{} err = c.client.Get(). Resource("persistentVolumes"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) @@ -94,6 +94,6 @@ func (c *persistentVolumes) Watch(opts api.ListOptions) (watch.Interface, error) return c.client.Get(). Prefix("watch"). Resource("persistentVolumes"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/pod_templates.go b/pkg/client/unversioned/pod_templates.go index aa1f371d477..ed5b733c678 100644 --- a/pkg/client/unversioned/pod_templates.go +++ b/pkg/client/unversioned/pod_templates.go @@ -53,7 +53,7 @@ func newPodTemplates(c *Client, namespace string) *podTemplates { // List takes label and field selectors, and returns the list of podTemplates that match those selectors. func (c *podTemplates) List(opts api.ListOptions) (result *api.PodTemplateList, err error) { result = &api.PodTemplateList{} - err = c.r.Get().Namespace(c.ns).Resource("podTemplates").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.r.Get().Namespace(c.ns).Resource("podTemplates").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -89,6 +89,6 @@ func (c *podTemplates) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("podTemplates"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/pods.go b/pkg/client/unversioned/pods.go index 566b86269e9..04bb989c2a0 100644 --- a/pkg/client/unversioned/pods.go +++ b/pkg/client/unversioned/pods.go @@ -56,7 +56,7 @@ func newPods(c *Client, namespace string) *pods { // List takes label and field selectors, and returns the list of pods that match those selectors. func (c *pods) List(opts api.ListOptions) (result *api.PodList, err error) { result = &api.PodList{} - err = c.r.Get().Namespace(c.ns).Resource("pods").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.r.Get().Namespace(c.ns).Resource("pods").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -92,7 +92,7 @@ func (c *pods) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("pods"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } @@ -110,5 +110,5 @@ func (c *pods) UpdateStatus(pod *api.Pod) (result *api.Pod, err error) { // Get constructs a request for getting the logs for a pod func (c *pods) GetLogs(name string, opts *api.PodLogOptions) *Request { - return c.r.Get().Namespace(c.ns).Name(name).Resource("pods").SubResource("log").VersionedParams(opts, api.Scheme) + return c.r.Get().Namespace(c.ns).Name(name).Resource("pods").SubResource("log").VersionedParams(opts, api.ParameterCodec) } diff --git a/pkg/client/unversioned/replica_sets.go b/pkg/client/unversioned/replica_sets.go index 93254538359..be9284084f7 100644 --- a/pkg/client/unversioned/replica_sets.go +++ b/pkg/client/unversioned/replica_sets.go @@ -52,7 +52,7 @@ func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets { // List takes a selector, and returns the list of ReplicaSets that match that selector. func (c *replicaSets) List(opts api.ListOptions) (result *extensions.ReplicaSetList, err error) { result = &extensions.ReplicaSetList{} - err = c.client.Get().Namespace(c.ns).Resource("replicasets").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.client.Get().Namespace(c.ns).Resource("replicasets").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -95,6 +95,6 @@ func (c *replicaSets) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("replicasets"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/replication_controllers.go b/pkg/client/unversioned/replication_controllers.go index 828a47ce6ea..f237a76acf3 100644 --- a/pkg/client/unversioned/replication_controllers.go +++ b/pkg/client/unversioned/replication_controllers.go @@ -51,7 +51,7 @@ func newReplicationControllers(c *Client, namespace string) *replicationControll // List takes a selector, and returns the list of replication controllers that match that selector. func (c *replicationControllers) List(opts api.ListOptions) (result *api.ReplicationControllerList, err error) { result = &api.ReplicationControllerList{} - err = c.r.Get().Namespace(c.ns).Resource("replicationControllers").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.r.Get().Namespace(c.ns).Resource("replicationControllers").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -94,6 +94,6 @@ func (c *replicationControllers) Watch(opts api.ListOptions) (watch.Interface, e Prefix("watch"). Namespace(c.ns). Resource("replicationControllers"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/request.go b/pkg/client/unversioned/request.go index 94f93b9d37b..3789cdccd2a 100644 --- a/pkg/client/unversioned/request.go +++ b/pkg/client/unversioned/request.go @@ -36,7 +36,6 @@ import ( "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/validation" "k8s.io/kubernetes/pkg/client/metrics" - "k8s.io/kubernetes/pkg/conversion/queryparams" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" @@ -425,18 +424,13 @@ func (r *Request) Param(paramName, s string) *Request { } // VersionedParams will take the provided object, serialize it to a map[string][]string using the -// implicit RESTClient API version and the provided object convertor, and then add those as parameters +// implicit RESTClient API version and the default parameter codec, and then add those as parameters // to the request. Use this to provide versioned query parameters from client libraries. -func (r *Request) VersionedParams(obj runtime.Object, convertor runtime.ObjectConvertor) *Request { +func (r *Request) VersionedParams(obj runtime.Object, codec runtime.ParameterCodec) *Request { if r.err != nil { return r } - versioned, err := convertor.ConvertToVersion(obj, r.content.GroupVersion.String()) - if err != nil { - r.err = err - return r - } - params, err := queryparams.Convert(versioned) + params, err := codec.EncodeParameters(obj, *r.content.GroupVersion) if err != nil { r.err = err return r diff --git a/pkg/client/unversioned/request_test.go b/pkg/client/unversioned/request_test.go index ffd1cacc3af..e0823a7909d 100644 --- a/pkg/client/unversioned/request_test.go +++ b/pkg/client/unversioned/request_test.go @@ -194,7 +194,7 @@ func TestRequestVersionedParams(t *testing.T) { if !reflect.DeepEqual(r.params, url.Values{"foo": []string{"a"}}) { t.Errorf("should have set a param: %#v", r) } - r.VersionedParams(&api.PodLogOptions{Follow: true, Container: "bar"}, api.Scheme) + r.VersionedParams(&api.PodLogOptions{Follow: true, Container: "bar"}, api.ParameterCodec) if !reflect.DeepEqual(r.params, url.Values{ "foo": []string{"a"}, @@ -207,7 +207,7 @@ func TestRequestVersionedParams(t *testing.T) { func TestRequestVersionedParamsFromListOptions(t *testing.T) { r := &Request{content: ContentConfig{GroupVersion: &v1.SchemeGroupVersion}} - r.VersionedParams(&api.ListOptions{ResourceVersion: "1"}, api.Scheme) + r.VersionedParams(&api.ListOptions{ResourceVersion: "1"}, api.ParameterCodec) if !reflect.DeepEqual(r.params, url.Values{ "resourceVersion": []string{"1"}, }) { @@ -215,7 +215,7 @@ func TestRequestVersionedParamsFromListOptions(t *testing.T) { } var timeout int64 = 10 - r.VersionedParams(&api.ListOptions{ResourceVersion: "2", TimeoutSeconds: &timeout}, api.Scheme) + r.VersionedParams(&api.ListOptions{ResourceVersion: "2", TimeoutSeconds: &timeout}, api.ParameterCodec) if !reflect.DeepEqual(r.params, url.Values{ "resourceVersion": []string{"1", "2"}, "timeoutSeconds": []string{"10"}, diff --git a/pkg/client/unversioned/resource_quotas.go b/pkg/client/unversioned/resource_quotas.go index 1eed04d018b..acfd8ddb32c 100644 --- a/pkg/client/unversioned/resource_quotas.go +++ b/pkg/client/unversioned/resource_quotas.go @@ -54,7 +54,7 @@ func newResourceQuotas(c *Client, namespace string) *resourceQuotas { // List takes a selector, and returns the list of resourceQuotas that match that selector. func (c *resourceQuotas) List(opts api.ListOptions) (result *api.ResourceQuotaList, err error) { result = &api.ResourceQuotaList{} - err = c.r.Get().Namespace(c.ns).Resource("resourceQuotas").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.r.Get().Namespace(c.ns).Resource("resourceQuotas").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -97,6 +97,6 @@ func (c *resourceQuotas) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("resourceQuotas"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/secrets.go b/pkg/client/unversioned/secrets.go index 3f675a68b29..33d77ad249d 100644 --- a/pkg/client/unversioned/secrets.go +++ b/pkg/client/unversioned/secrets.go @@ -67,7 +67,7 @@ func (s *secrets) List(opts api.ListOptions) (*api.SecretList, error) { err := s.client.Get(). Namespace(s.namespace). Resource("secrets"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) @@ -93,7 +93,7 @@ func (s *secrets) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(s.namespace). Resource("secrets"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/service_accounts.go b/pkg/client/unversioned/service_accounts.go index d826dfc95d5..d78a25c473a 100644 --- a/pkg/client/unversioned/service_accounts.go +++ b/pkg/client/unversioned/service_accounts.go @@ -67,7 +67,7 @@ func (s *serviceAccounts) List(opts api.ListOptions) (*api.ServiceAccountList, e err := s.client.Get(). Namespace(s.namespace). Resource("serviceAccounts"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) @@ -93,7 +93,7 @@ func (s *serviceAccounts) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(s.namespace). Resource("serviceAccounts"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/services.go b/pkg/client/unversioned/services.go index e19c4939957..ff25e226fdc 100644 --- a/pkg/client/unversioned/services.go +++ b/pkg/client/unversioned/services.go @@ -55,7 +55,7 @@ func (c *services) List(opts api.ListOptions) (result *api.ServiceList, err erro err = c.r.Get(). Namespace(c.ns). Resource("services"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return @@ -93,7 +93,7 @@ func (c *services) Watch(opts api.ListOptions) (watch.Interface, error) { Prefix("watch"). Namespace(c.ns). Resource("services"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/client/unversioned/thirdpartyresources.go b/pkg/client/unversioned/thirdpartyresources.go index 7f923ee366e..09bc4e4afc8 100644 --- a/pkg/client/unversioned/thirdpartyresources.go +++ b/pkg/client/unversioned/thirdpartyresources.go @@ -52,7 +52,7 @@ var _ ThirdPartyResourceInterface = &thirdPartyResources{} func (c *thirdPartyResources) List(opts api.ListOptions) (result *extensions.ThirdPartyResourceList, err error) { result = &extensions.ThirdPartyResourceList{} - err = c.r.Get().Namespace(c.ns).Resource("thirdpartyresources").VersionedParams(&opts, api.Scheme).Do().Into(result) + err = c.r.Get().Namespace(c.ns).Resource("thirdpartyresources").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) return } @@ -95,6 +95,6 @@ func (c *thirdPartyResources) Watch(opts api.ListOptions) (watch.Interface, erro Prefix("watch"). Namespace(c.ns). Resource("thirdpartyresources"). - VersionedParams(&opts, api.Scheme). + VersionedParams(&opts, api.ParameterCodec). Watch() } diff --git a/pkg/kubectl/cmd/attach.go b/pkg/kubectl/cmd/attach.go index ad22ef460e0..22f1ddb3bac 100644 --- a/pkg/kubectl/cmd/attach.go +++ b/pkg/kubectl/cmd/attach.go @@ -219,7 +219,7 @@ func (p *AttachOptions) Run() error { Stdout: p.Out != nil, Stderr: p.Err != nil, TTY: tty, - }, api.Scheme) + }, api.ParameterCodec) err = p.Attach.Attach("POST", req.URL(), p.Config, stdin, p.Out, p.Err, tty) if err != nil { diff --git a/pkg/kubectl/cmd/exec.go b/pkg/kubectl/cmd/exec.go index eef02355bbc..eec6da62fcd 100644 --- a/pkg/kubectl/cmd/exec.go +++ b/pkg/kubectl/cmd/exec.go @@ -233,7 +233,7 @@ func (p *ExecOptions) Run() error { Stdout: p.Out != nil, Stderr: p.Err != nil, TTY: tty, - }, api.Scheme) + }, api.ParameterCodec) return p.Executor.Execute("POST", req.URL(), p.Config, stdin, p.Out, p.Err, tty) }