Use VersionedParams in "extensions" client.

This commit is contained in:
Wojciech Tyczynski
2015-11-26 10:40:45 +01:00
parent 1dc513d390
commit cdded4f011
13 changed files with 45 additions and 48 deletions

View File

@@ -19,6 +19,7 @@ package cache
import (
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/fields"
@@ -60,9 +61,7 @@ func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSe
Prefix("watch").
Namespace(namespace).
Resource(resource).
// TODO: Use VersionedParams once this is supported for non v1 API.
Param("resourceVersion", options.ResourceVersion).
TimeoutSeconds(timeoutFromListOptions(options)).
VersionedParams(&options, api.Scheme).
FieldsSelectorParam(fieldSelector).
Watch()
}

View File

@@ -117,7 +117,7 @@ func TestListWatchesCanWatch(t *testing.T) {
{
location: buildLocation(
testapi.Default.ResourcePathWithPrefix("watch", "nodes", api.NamespaceAll, ""),
buildQueryValues(url.Values{"resourceVersion": []string{""}})),
buildQueryValues(url.Values{})),
rv: "",
resource: "nodes",
namespace: api.NamespaceAll,