mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #20252 from smarterclayton/parameter_codec
Auto commit by PR queue bot
This commit is contained in:
commit
03ed851c11
@ -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
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
`
|
||||
|
@ -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()
|
||||
}
|
||||
|
4
pkg/client/cache/listwatch.go
vendored
4
pkg/client/cache/listwatch.go
vendored
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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"},
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user