diff --git a/cmd/integration/integration.go b/cmd/integration/integration.go index eb02f45e58c03..02058ed2478cf 100644 --- a/cmd/integration/integration.go +++ b/cmd/integration/integration.go @@ -38,6 +38,7 @@ import ( apierrors "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller" @@ -423,7 +424,7 @@ containers: } func runReplicationControllerTest(c *client.Client) { - clientAPIVersion := c.APIVersion() + clientAPIVersion := c.APIVersion().String() data, err := ioutil.ReadFile("cmd/integration/" + clientAPIVersion + "-controller.json") if err != nil { glog.Fatalf("Unexpected error: %v", err) @@ -462,7 +463,7 @@ func runReplicationControllerTest(c *client.Client) { func runAPIVersionsTest(c *client.Client) { v, err := c.ServerAPIVersions() - clientVersion := c.APIVersion() + clientVersion := c.APIVersion().String() if err != nil { glog.Fatalf("Failed to get api versions: %v", err) } @@ -541,7 +542,7 @@ func runSelfLinkTestOnNamespace(c *client.Client, namespace string) { func runAtomicPutTest(c *client.Client) { svcBody := api.Service{ TypeMeta: unversioned.TypeMeta{ - APIVersion: c.APIVersion(), + APIVersion: c.APIVersion().String(), }, ObjectMeta: api.ObjectMeta{ Name: "atomicservice", @@ -623,7 +624,7 @@ func runPatchTest(c *client.Client) { resource := "services" svcBody := api.Service{ TypeMeta: unversioned.TypeMeta{ - APIVersion: c.APIVersion(), + APIVersion: c.APIVersion().String(), }, ObjectMeta: api.ObjectMeta{ Name: name, @@ -647,12 +648,12 @@ func runPatchTest(c *client.Client) { glog.Fatalf("Failed creating patchservice: %v", err) } - patchBodies := map[string]map[api.PatchType]struct { + patchBodies := map[unversioned.GroupVersion]map[api.PatchType]struct { AddLabelBody []byte RemoveLabelBody []byte RemoveAllLabelsBody []byte }{ - "v1": { + v1.SchemeGroupVersion: { api.JSONPatchType: { []byte(`[{"op":"add","path":"/metadata/labels","value":{"foo":"bar","baz":"qux"}}]`), []byte(`[{"op":"remove","path":"/metadata/labels/foo"}]`), diff --git a/pkg/api/unversioned/register.go b/pkg/api/unversioned/register.go new file mode 100644 index 0000000000000..51045521b22fa --- /dev/null +++ b/pkg/api/unversioned/register.go @@ -0,0 +1,20 @@ +/* +Copyright 2014 The Kubernetes Authors All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package unversioned + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = GroupVersion{Group: "", Version: ""} diff --git a/pkg/client/unversioned/deployment.go b/pkg/client/unversioned/deployment.go index 32a13e5588f1c..0b94112c5abd6 100644 --- a/pkg/client/unversioned/deployment.go +++ b/pkg/client/unversioned/deployment.go @@ -72,7 +72,7 @@ func (c *deployments) Delete(name string, options *api.DeleteOptions) error { if options == nil { return c.client.Delete().Namespace(c.ns).Resource("deployments").Name(name).Do().Error() } - body, err := api.Scheme.EncodeToVersion(options, c.client.APIVersion()) + body, err := api.Scheme.EncodeToVersion(options, c.client.APIVersion().String()) if err != nil { return err } diff --git a/pkg/client/unversioned/events.go b/pkg/client/unversioned/events.go index 5128d0f9a46be..920aace616f01 100644 --- a/pkg/client/unversioned/events.go +++ b/pkg/client/unversioned/events.go @@ -187,7 +187,7 @@ func (e *events) Delete(name string) error { // Returns the appropriate field selector based on the API version being used to communicate with the server. // The returned field selector can be used with List and Watch to filter desired events. func (e *events) GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector { - apiVersion := e.client.APIVersion() + apiVersion := e.client.APIVersion().String() field := fields.Set{} if involvedObjectName != nil { field[getInvolvedObjectNameFieldLabel(apiVersion)] = *involvedObjectName diff --git a/pkg/client/unversioned/fake/fake.go b/pkg/client/unversioned/fake/fake.go index b4a867d567a55..eca37eedb693c 100644 --- a/pkg/client/unversioned/fake/fake.go +++ b/pkg/client/unversioned/fake/fake.go @@ -50,23 +50,23 @@ type RESTClient struct { } func (c *RESTClient) Get() *unversioned.Request { - return unversioned.NewRequest(c, "GET", &url.URL{Host: "localhost"}, testapi.Default.Version(), c.Codec) + return unversioned.NewRequest(c, "GET", &url.URL{Host: "localhost"}, *testapi.Default.GroupVersion(), c.Codec) } func (c *RESTClient) Put() *unversioned.Request { - return unversioned.NewRequest(c, "PUT", &url.URL{Host: "localhost"}, testapi.Default.Version(), c.Codec) + return unversioned.NewRequest(c, "PUT", &url.URL{Host: "localhost"}, *testapi.Default.GroupVersion(), c.Codec) } func (c *RESTClient) Patch(_ api.PatchType) *unversioned.Request { - return unversioned.NewRequest(c, "PATCH", &url.URL{Host: "localhost"}, testapi.Default.Version(), c.Codec) + return unversioned.NewRequest(c, "PATCH", &url.URL{Host: "localhost"}, *testapi.Default.GroupVersion(), c.Codec) } func (c *RESTClient) Post() *unversioned.Request { - return unversioned.NewRequest(c, "POST", &url.URL{Host: "localhost"}, testapi.Default.Version(), c.Codec) + return unversioned.NewRequest(c, "POST", &url.URL{Host: "localhost"}, *testapi.Default.GroupVersion(), c.Codec) } func (c *RESTClient) Delete() *unversioned.Request { - return unversioned.NewRequest(c, "DELETE", &url.URL{Host: "localhost"}, testapi.Default.Version(), c.Codec) + return unversioned.NewRequest(c, "DELETE", &url.URL{Host: "localhost"}, *testapi.Default.GroupVersion(), c.Codec) } func (c *RESTClient) Do(req *http.Request) (*http.Response, error) { diff --git a/pkg/client/unversioned/helper.go b/pkg/client/unversioned/helper.go index 962d258eb8dfe..6fe6253cb9a73 100644 --- a/pkg/client/unversioned/helper.go +++ b/pkg/client/unversioned/helper.go @@ -397,7 +397,7 @@ func RESTClientFor(config *Config) (*RESTClient, error) { return nil, err } - client := NewRESTClient(baseURL, config.GroupVersion.String(), config.Codec, config.QPS, config.Burst) + client := NewRESTClient(baseURL, *config.GroupVersion, config.Codec, config.QPS, config.Burst) transport, err := TransportFor(config) if err != nil { @@ -422,7 +422,7 @@ func UnversionedRESTClientFor(config *Config) (*RESTClient, error) { return nil, err } - client := NewRESTClient(baseURL, "", config.Codec, config.QPS, config.Burst) + client := NewRESTClient(baseURL, unversioned.SchemeGroupVersion, config.Codec, config.QPS, config.Burst) transport, err := TransportFor(config) if err != nil { diff --git a/pkg/client/unversioned/horizontalpodautoscaler.go b/pkg/client/unversioned/horizontalpodautoscaler.go index 6c87f6a780bd7..fe82ddc9958cc 100644 --- a/pkg/client/unversioned/horizontalpodautoscaler.go +++ b/pkg/client/unversioned/horizontalpodautoscaler.go @@ -73,7 +73,7 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOption if options == nil { return c.client.Delete().Namespace(c.ns).Resource("horizontalPodAutoscalers").Name(name).Do().Error() } - body, err := api.Scheme.EncodeToVersion(options, c.client.APIVersion()) + body, err := api.Scheme.EncodeToVersion(options, c.client.APIVersion().String()) if err != nil { return err } diff --git a/pkg/client/unversioned/ingress.go b/pkg/client/unversioned/ingress.go index af83a037d7d57..2c273f21ff569 100644 --- a/pkg/client/unversioned/ingress.go +++ b/pkg/client/unversioned/ingress.go @@ -84,7 +84,7 @@ func (c *ingress) Delete(name string, options *api.DeleteOptions) (err error) { return c.r.Delete().Namespace(c.ns).Resource("ingresses").Name(name).Do().Error() } - body, err := api.Scheme.EncodeToVersion(options, c.r.APIVersion()) + body, err := api.Scheme.EncodeToVersion(options, c.r.APIVersion().String()) if err != nil { return err } diff --git a/pkg/client/unversioned/pod_templates.go b/pkg/client/unversioned/pod_templates.go index 3ce25e0c83c01..18c6b37c0941f 100644 --- a/pkg/client/unversioned/pod_templates.go +++ b/pkg/client/unversioned/pod_templates.go @@ -71,7 +71,7 @@ func (c *podTemplates) Delete(name string, options *api.DeleteOptions) error { if options == nil { return c.r.Delete().Namespace(c.ns).Resource("podTemplates").Name(name).Do().Error() } - body, err := api.Scheme.EncodeToVersion(options, c.r.APIVersion()) + body, err := api.Scheme.EncodeToVersion(options, c.r.APIVersion().String()) if err != nil { return err } diff --git a/pkg/client/unversioned/pods.go b/pkg/client/unversioned/pods.go index 49cb2221a8d8d..5fbe2471a244a 100644 --- a/pkg/client/unversioned/pods.go +++ b/pkg/client/unversioned/pods.go @@ -74,7 +74,7 @@ func (c *pods) Delete(name string, options *api.DeleteOptions) error { if options == nil { return c.r.Delete().Namespace(c.ns).Resource("pods").Name(name).Do().Error() } - body, err := api.Scheme.EncodeToVersion(options, c.r.APIVersion()) + body, err := api.Scheme.EncodeToVersion(options, c.r.APIVersion().String()) if err != nil { return err } diff --git a/pkg/client/unversioned/remotecommand/remotecommand_test.go b/pkg/client/unversioned/remotecommand/remotecommand_test.go index 536c63ee08079..1941f22b936f1 100644 --- a/pkg/client/unversioned/remotecommand/remotecommand_test.go +++ b/pkg/client/unversioned/remotecommand/remotecommand_test.go @@ -28,6 +28,7 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/util/httpstream" "k8s.io/kubernetes/pkg/util/httpstream/spdy" @@ -189,7 +190,7 @@ func TestRequestExecuteRemoteCommand(t *testing.T) { server := httptest.NewServer(fakeExecServer(t, i, testCase.Stdin, testCase.Stdout, testCase.Stderr, testCase.Error, testCase.Tty, testCase.MessageCount)) url, _ := url.ParseRequestURI(server.URL) - c := client.NewRESTClient(url, "x", nil, -1, -1) + c := client.NewRESTClient(url, unversioned.GroupVersion{Group: "x"}, nil, -1, -1) req := c.Post().Resource("testing") req.SetHeader(httpstream.HeaderProtocolVersion, StreamProtocolV2Name) req.Param("command", "ls") @@ -271,7 +272,7 @@ func TestRequestAttachRemoteCommand(t *testing.T) { server := httptest.NewServer(fakeExecServer(t, i, testCase.Stdin, testCase.Stdout, testCase.Stderr, testCase.Error, testCase.Tty, 1)) url, _ := url.ParseRequestURI(server.URL) - c := client.NewRESTClient(url, "x", nil, -1, -1) + c := client.NewRESTClient(url, unversioned.GroupVersion{Group: "x"}, nil, -1, -1) req := c.Post().Resource("testing") conf := &client.Config{ diff --git a/pkg/client/unversioned/request.go b/pkg/client/unversioned/request.go index 5af23dfc10ba4..d71a6909fda6e 100644 --- a/pkg/client/unversioned/request.go +++ b/pkg/client/unversioned/request.go @@ -32,6 +32,7 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/validation" "k8s.io/kubernetes/pkg/client/metrics" "k8s.io/kubernetes/pkg/conversion/queryparams" @@ -99,7 +100,7 @@ type Request struct { selector labels.Selector timeout time.Duration - apiVersion string + groupVersion unversioned.GroupVersion // output err error @@ -111,15 +112,14 @@ type Request struct { } // NewRequest creates a new request helper object for accessing runtime.Objects on a server. -func NewRequest(client HTTPClient, verb string, baseURL *url.URL, apiVersion string, - codec runtime.Codec) *Request { +func NewRequest(client HTTPClient, verb string, baseURL *url.URL, groupVersion unversioned.GroupVersion, codec runtime.Codec) *Request { return &Request{ - client: client, - verb: verb, - baseURL: baseURL, - path: baseURL.Path, - apiVersion: apiVersion, - codec: codec, + client: client, + verb: verb, + baseURL: baseURL, + path: baseURL.Path, + groupVersion: groupVersion, + codec: codec, } } @@ -308,25 +308,25 @@ func (r resourceTypeToFieldMapping) filterField(resourceType, field, value strin return fMapping.filterField(field, value) } -type versionToResourceToFieldMapping map[string]resourceTypeToFieldMapping +type versionToResourceToFieldMapping map[unversioned.GroupVersion]resourceTypeToFieldMapping -func (v versionToResourceToFieldMapping) filterField(apiVersion, resourceType, field, value string) (newField, newValue string, err error) { - rMapping, ok := v[apiVersion] +func (v versionToResourceToFieldMapping) filterField(groupVersion unversioned.GroupVersion, resourceType, field, value string) (newField, newValue string, err error) { + rMapping, ok := v[groupVersion] if !ok { - glog.Warningf("Field selector: %v - %v - %v - %v: need to check if this is versioned correctly.", apiVersion, resourceType, field, value) + glog.Warningf("Field selector: %v - %v - %v - %v: need to check if this is versioned correctly.", groupVersion, resourceType, field, value) return field, value, nil } newField, newValue, err = rMapping.filterField(resourceType, field, value) if err != nil { // This is only a warning until we find and fix all of the client's usages. - glog.Warningf("Field selector: %v - %v - %v - %v: need to check if this is versioned correctly.", apiVersion, resourceType, field, value) + glog.Warningf("Field selector: %v - %v - %v - %v: need to check if this is versioned correctly.", groupVersion, resourceType, field, value) return field, value, nil } return newField, newValue, nil } var fieldMappings = versionToResourceToFieldMapping{ - "v1": resourceTypeToFieldMapping{ + v1.SchemeGroupVersion: resourceTypeToFieldMapping{ "nodes": clientFieldNameToAPIVersionFieldName{ ObjectNameField: ObjectNameField, NodeUnschedulable: NodeUnschedulable, @@ -371,13 +371,13 @@ func (r *Request) FieldsSelectorParam(s fields.Selector) *Request { return r } s2, err := s.Transform(func(field, value string) (newField, newValue string, err error) { - return fieldMappings.filterField(r.apiVersion, r.resource, field, value) + return fieldMappings.filterField(r.groupVersion, r.resource, field, value) }) if err != nil { r.err = err return r } - return r.setParam(unversioned.FieldSelectorQueryParam(r.apiVersion), s2.String()) + return r.setParam(unversioned.FieldSelectorQueryParam(r.groupVersion.String()), s2.String()) } // LabelsSelectorParam adds the given selector as a query parameter @@ -391,7 +391,7 @@ func (r *Request) LabelsSelectorParam(s labels.Selector) *Request { if s.Empty() { return r } - return r.setParam(unversioned.LabelSelectorQueryParam(r.apiVersion), s.String()) + return r.setParam(unversioned.LabelSelectorQueryParam(r.groupVersion.String()), s.String()) } // UintParam creates a query parameter with the given value. @@ -417,7 +417,7 @@ func (r *Request) VersionedParams(obj runtime.Object, convertor runtime.ObjectCo if r.err != nil { return r } - versioned, err := convertor.ConvertToVersion(obj, r.apiVersion) + versioned, err := convertor.ConvertToVersion(obj, r.groupVersion.String()) if err != nil { r.err = err return r @@ -431,14 +431,14 @@ func (r *Request) VersionedParams(obj runtime.Object, convertor runtime.ObjectCo for _, value := range v { // TODO: Move it to setParam method, once we get rid of // FieldSelectorParam & LabelSelectorParam methods. - if k == unversioned.LabelSelectorQueryParam(r.apiVersion) && value == "" { + if k == unversioned.LabelSelectorQueryParam(r.groupVersion.String()) && value == "" { // Don't set an empty selector for backward compatibility. // Since there is no way to get the difference between empty // and unspecified string, we don't set it to avoid having // labelSelector= param in every request. continue } - if k == unversioned.FieldSelectorQueryParam(r.apiVersion) { + if k == unversioned.FieldSelectorQueryParam(r.groupVersion.String()) { if value == "" { // Don't set an empty selector for backward compatibility. // Since there is no way to get the difference between empty @@ -454,7 +454,7 @@ func (r *Request) VersionedParams(obj runtime.Object, convertor runtime.ObjectCo } filteredSelector, err := selector.Transform( func(field, value string) (newField, newValue string, err error) { - return fieldMappings.filterField(r.apiVersion, r.resource, field, value) + return fieldMappings.filterField(r.groupVersion, r.resource, field, value) }) if err != nil { r.err = fmt.Errorf("untransformable field selector: %v", err) diff --git a/pkg/client/unversioned/request_test.go b/pkg/client/unversioned/request_test.go index db4fef4cca524..9b02b8e09e3f9 100644 --- a/pkg/client/unversioned/request_test.go +++ b/pkg/client/unversioned/request_test.go @@ -34,6 +34,7 @@ import ( apierrors "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/testapi" "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/util" @@ -45,8 +46,8 @@ import ( func TestRequestWithErrorWontChange(t *testing.T) { original := Request{ - err: errors.New("test"), - apiVersion: testapi.Default.Version(), + err: errors.New("test"), + groupVersion: *testapi.Default.GroupVersion(), } r := original changed := r.Param("foo", "bar"). @@ -177,7 +178,7 @@ func TestRequestParam(t *testing.T) { } func TestRequestVersionedParams(t *testing.T) { - r := (&Request{apiVersion: "v1"}).Param("foo", "a") + r := (&Request{groupVersion: v1.SchemeGroupVersion}).Param("foo", "a") if !reflect.DeepEqual(r.params, url.Values{"foo": []string{"a"}}) { t.Errorf("should have set a param: %#v", r) } @@ -193,7 +194,7 @@ func TestRequestVersionedParams(t *testing.T) { } func TestRequestVersionedParamsFromListOptions(t *testing.T) { - r := &Request{apiVersion: "v1"} + r := &Request{groupVersion: v1.SchemeGroupVersion} r.VersionedParams(&unversioned.ListOptions{ResourceVersion: "1"}, api.Scheme) if !reflect.DeepEqual(r.params, url.Values{ "resourceVersion": []string{"1"}, @@ -261,7 +262,7 @@ func TestResultIntoWithErrReturnsErr(t *testing.T) { func TestURLTemplate(t *testing.T) { uri, _ := url.Parse("http://localhost") - r := NewRequest(nil, "POST", uri, "test", nil) + r := NewRequest(nil, "POST", uri, unversioned.GroupVersion{Group: "test"}, nil) r.Prefix("pre1").Resource("r1").Namespace("ns").Name("nm").Param("p0", "v0") full := r.URL() if full.String() != "http://localhost/pre1/namespaces/ns/r1/nm?p0=v0" { @@ -322,7 +323,7 @@ func TestTransformResponse(t *testing.T) { {Response: &http.Response{StatusCode: 200, Body: ioutil.NopCloser(bytes.NewReader(invalid))}, Data: invalid}, } for i, test := range testCases { - r := NewRequest(nil, "", uri, testapi.Default.Version(), testapi.Default.Codec()) + r := NewRequest(nil, "", uri, *testapi.Default.GroupVersion(), testapi.Default.Codec()) if test.Response.Body == nil { test.Response.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) } @@ -1029,7 +1030,7 @@ func TestUintParam(t *testing.T) { for _, item := range table { u, _ := url.Parse("http://localhost") - r := NewRequest(nil, "GET", u, "test", nil).AbsPath("").UintParam(item.name, item.testVal) + r := NewRequest(nil, "GET", u, unversioned.GroupVersion{Group: "test"}, nil).AbsPath("").UintParam(item.name, item.testVal) if e, a := item.expectStr, r.URL().String(); e != a { t.Errorf("expected %v, got %v", e, a) } @@ -1200,5 +1201,5 @@ func testRESTClient(t testing.TB, srv *httptest.Server) *RESTClient { } } baseURL.Path = testapi.Default.ResourcePath("", "", "") - return NewRESTClient(baseURL, testapi.Default.GroupVersion().String(), testapi.Default.Codec(), 0, 0) + return NewRESTClient(baseURL, *testapi.Default.GroupVersion(), testapi.Default.Codec(), 0, 0) } diff --git a/pkg/client/unversioned/restclient.go b/pkg/client/unversioned/restclient.go index 6c2881deedb70..219e94cdec693 100644 --- a/pkg/client/unversioned/restclient.go +++ b/pkg/client/unversioned/restclient.go @@ -22,6 +22,7 @@ import ( "strings" "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/util" ) @@ -36,7 +37,7 @@ import ( type RESTClient struct { baseURL *url.URL // A string identifying the version of the API this client is expected to use. - apiVersion string + groupVersion unversioned.GroupVersion // Codec is the encoding and decoding scheme that applies to a particular set of // REST resources. @@ -53,7 +54,7 @@ type RESTClient struct { // NewRESTClient creates a new RESTClient. This client performs generic REST functions // such as Get, Put, Post, and Delete on specified paths. Codec controls encoding and // decoding of responses from the server. -func NewRESTClient(baseURL *url.URL, apiVersion string, c runtime.Codec, maxQPS float32, maxBurst int) *RESTClient { +func NewRESTClient(baseURL *url.URL, groupVersion unversioned.GroupVersion, c runtime.Codec, maxQPS float32, maxBurst int) *RESTClient { base := *baseURL if !strings.HasSuffix(base.Path, "/") { base.Path += "/" @@ -66,10 +67,10 @@ func NewRESTClient(baseURL *url.URL, apiVersion string, c runtime.Codec, maxQPS throttle = util.NewTokenBucketRateLimiter(maxQPS, maxBurst) } return &RESTClient{ - baseURL: &base, - apiVersion: apiVersion, - Codec: c, - Throttle: throttle, + baseURL: &base, + groupVersion: groupVersion, + Codec: c, + Throttle: throttle, } } @@ -90,9 +91,9 @@ func (c *RESTClient) Verb(verb string) *Request { c.Throttle.Accept() } if c.Client == nil { - return NewRequest(nil, verb, c.baseURL, c.apiVersion, c.Codec) + return NewRequest(nil, verb, c.baseURL, c.groupVersion, c.Codec) } - return NewRequest(c.Client, verb, c.baseURL, c.apiVersion, c.Codec) + return NewRequest(c.Client, verb, c.baseURL, c.groupVersion, c.Codec) } // Post begins a POST request. Short for c.Verb("POST"). @@ -121,6 +122,6 @@ func (c *RESTClient) Delete() *Request { } // APIVersion returns the APIVersion this RESTClient is expected to use. -func (c *RESTClient) APIVersion() string { - return c.apiVersion +func (c *RESTClient) APIVersion() unversioned.GroupVersion { + return c.groupVersion }