From 960808bf08feb1c816aa3ba4d9f62ab59a164448 Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Thu, 10 Dec 2015 10:39:03 +0100 Subject: [PATCH] Switch to versioned ListOptions in client. --- cmd/integration/integration.go | 10 ++-- contrib/mesos/pkg/executor/executor_test.go | 4 +- .../components/framework/framework.go | 5 +- .../scheduler/integration/integration_test.go | 4 +- .../mesos/pkg/service/endpoints_controller.go | 11 ++-- pkg/api/conversion.go | 8 +++ pkg/api/register.go | 3 +- pkg/api/testing/fuzzer.go | 6 ++ pkg/api/types.go | 19 ++++++ pkg/apis/extensions/register.go | 5 +- pkg/apis/extensions/v1beta1/register.go | 6 +- pkg/apis/extensions/v1beta1/types.go | 20 +++++++ pkg/client/cache/listwatch.go | 15 +++-- pkg/client/cache/listwatch_test.go | 4 +- pkg/client/cache/reflector.go | 10 ++-- pkg/client/cache/reflector_test.go | 4 +- pkg/client/unversioned/componentstatuses.go | 7 +-- pkg/client/unversioned/daemon_sets.go | 9 ++- pkg/client/unversioned/daemon_sets_test.go | 3 +- pkg/client/unversioned/deployment.go | 9 ++- pkg/client/unversioned/deployment_test.go | 6 +- pkg/client/unversioned/endpoints.go | 9 ++- pkg/client/unversioned/endpoints_test.go | 3 +- pkg/client/unversioned/events.go | 15 +++-- pkg/client/unversioned/events_test.go | 2 +- .../unversioned/horizontalpodautoscaler.go | 9 ++- .../horizontalpodautoscaler_test.go | 5 +- pkg/client/unversioned/ingress.go | 9 ++- pkg/client/unversioned/ingress_test.go | 3 +- pkg/client/unversioned/jobs.go | 9 ++- pkg/client/unversioned/jobs_test.go | 3 +- pkg/client/unversioned/limit_ranges.go | 9 ++- pkg/client/unversioned/limit_ranges_test.go | 5 +- pkg/client/unversioned/namespaces.go | 9 ++- pkg/client/unversioned/namespaces_test.go | 5 +- pkg/client/unversioned/nodes.go | 9 ++- pkg/client/unversioned/nodes_test.go | 4 +- .../unversioned/persistentvolume_test.go | 5 +- .../unversioned/persistentvolumeclaim.go | 9 ++- .../unversioned/persistentvolumeclaim_test.go | 5 +- pkg/client/unversioned/persistentvolumes.go | 9 ++- pkg/client/unversioned/pod_templates.go | 9 ++- pkg/client/unversioned/pod_templates_test.go | 5 +- pkg/client/unversioned/pods.go | 9 ++- pkg/client/unversioned/pods_test.go | 6 +- .../unversioned/replication_controllers.go | 9 ++- .../replication_controllers_test.go | 3 +- pkg/client/unversioned/request_test.go | 4 +- pkg/client/unversioned/resource_quotas.go | 9 ++- .../unversioned/resource_quotas_test.go | 5 +- pkg/client/unversioned/secrets.go | 9 ++- pkg/client/unversioned/service_accounts.go | 9 ++- pkg/client/unversioned/services.go | 9 ++- pkg/client/unversioned/services_test.go | 4 +- pkg/client/unversioned/testclient/actions.go | 38 ++++++------ .../testclient/fake_componentstatuses.go | 3 +- .../testclient/fake_daemon_sets.go | 6 +- .../testclient/fake_deployments.go | 7 +-- .../unversioned/testclient/fake_endpoints.go | 5 +- .../unversioned/testclient/fake_events.go | 11 ++-- .../fake_horizontal_pod_autoscalers.go | 7 +-- .../unversioned/testclient/fake_ingress.go | 5 +- .../unversioned/testclient/fake_jobs.go | 5 +- .../testclient/fake_limit_ranges.go | 5 +- .../unversioned/testclient/fake_namespaces.go | 5 +- .../unversioned/testclient/fake_nodes.go | 5 +- .../fake_persistent_volume_claims.go | 5 +- .../testclient/fake_persistent_volumes.go | 5 +- .../testclient/fake_pod_templates.go | 5 +- .../unversioned/testclient/fake_pods.go | 7 +-- .../fake_replication_controllers.go | 5 +- .../testclient/fake_resource_quotas.go | 5 +- .../unversioned/testclient/fake_secrets.go | 5 +- .../testclient/fake_service_accounts.go | 5 +- .../unversioned/testclient/fake_services.go | 5 +- .../testclient/fake_thirdpartyresources.go | 6 +- .../unversioned/testclient/testclient_test.go | 9 ++- pkg/client/unversioned/thirdpartyresources.go | 9 ++- .../unversioned/thirdpartyresources_test.go | 10 +--- pkg/controller/daemon/controller.go | 13 ++--- .../deployment/deployment_controller.go | 3 +- .../endpoint/endpoints_controller.go | 11 ++-- .../framework/fake_controller_source.go | 5 +- .../framework/fake_controller_source_test.go | 9 ++- pkg/controller/gc/gc_controller.go | 9 ++- pkg/controller/job/controller.go | 8 +-- .../namespace/namespace_controller.go | 32 +++++----- pkg/controller/node/nodecontroller.go | 16 ++--- pkg/controller/node/nodecontroller_test.go | 4 +- ...ersistentvolume_claim_binder_controller.go | 9 ++- ...persistentvolume_provisioner_controller.go | 25 ++++---- ...stentvolume_provisioner_controller_test.go | 9 ++- .../persistentvolume_recycler_controller.go | 5 +- pkg/controller/podautoscaler/horizontal.go | 2 +- .../podautoscaler/metrics/metrics_client.go | 3 +- .../replication/replication_controller.go | 9 ++- .../resource_quota_controller.go | 21 ++++--- pkg/controller/route/routecontroller.go | 3 +- .../serviceaccounts_controller.go | 13 ++--- .../serviceaccount/tokens_controller.go | 13 ++--- pkg/kubectl/cmd/util/factory.go | 2 +- pkg/kubectl/describe.go | 16 ++--- pkg/kubectl/rolling_updater.go | 9 ++- pkg/kubectl/stop.go | 4 +- pkg/kubelet/config/apiserver_test.go | 5 +- pkg/kubelet/kubelet.go | 12 ++-- pkg/proxy/config/api_test.go | 5 +- pkg/storage/cacher.go | 5 +- pkg/storage/watch_cache_test.go | 12 ++-- pkg/util/deployment/deployment.go | 9 ++- pkg/volume/util.go | 9 ++- plugin/pkg/admission/limitranger/admission.go | 5 +- .../namespace/autoprovision/admission.go | 5 +- .../admission/namespace/exists/admission.go | 5 +- .../namespace/lifecycle/admission.go | 5 +- .../pkg/admission/resourcequota/admission.go | 4 +- .../pkg/admission/serviceaccount/admission.go | 13 ++--- test/e2e/cadvisor.go | 4 +- test/e2e/cluster_size_autoscaling.go | 3 +- test/e2e/cluster_upgrade.go | 3 +- test/e2e/daemon_restart.go | 11 ++-- test/e2e/daemon_set.go | 10 ++-- test/e2e/density.go | 17 +++--- test/e2e/dns.go | 4 +- test/e2e/es_cluster_logging.go | 7 +-- test/e2e/etcd_failure.go | 5 +- test/e2e/events.go | 7 +-- test/e2e/example_cluster_dns.go | 5 +- test/e2e/example_k8petstore.go | 4 +- test/e2e/examples.go | 3 +- test/e2e/framework.go | 9 ++- test/e2e/garbage_collector.go | 3 +- test/e2e/ingress.go | 7 +-- test/e2e/job.go | 3 +- test/e2e/kibana_logging.go | 3 +- test/e2e/kubectl.go | 4 +- test/e2e/kubelet.go | 4 +- test/e2e/kubelet_perf.go | 4 +- test/e2e/kubelet_stats.go | 7 +-- test/e2e/kubeproxy.go | 6 +- test/e2e/latency.go | 13 ++--- test/e2e/load.go | 8 +-- test/e2e/mesos.go | 6 +- test/e2e/metrics_util.go | 4 +- test/e2e/monitor_resources.go | 4 +- test/e2e/monitoring.go | 11 ++-- test/e2e/namespace.go | 4 +- test/e2e/networking.go | 2 +- test/e2e/nodeoutofdisk.go | 5 +- test/e2e/pd.go | 2 +- test/e2e/pods.go | 19 +++--- test/e2e/proxy.go | 3 +- test/e2e/reboot.go | 3 +- test/e2e/resize_nodes.go | 6 +- test/e2e/scheduler_predicates.go | 20 +++---- test/e2e/service.go | 5 +- test/e2e/service_accounts.go | 3 +- test/e2e/service_latency.go | 5 +- test/e2e/serviceloadbalancers.go | 3 +- test/e2e/util.go | 58 +++++++++---------- test/integration/client_test.go | 9 ++- test/integration/framework/master_utils.go | 3 +- test/integration/metrics_test.go | 3 +- test/integration/persistent_volumes_test.go | 5 +- test/integration/service_account_test.go | 7 +-- test/soak/cauldron/cauldron.go | 3 +- test/soak/serve_hostnames/serve_hostnames.go | 2 +- 167 files changed, 602 insertions(+), 671 deletions(-) diff --git a/cmd/integration/integration.go b/cmd/integration/integration.go index 9870ea64c9a..b7a6f7ef16a 100644 --- a/cmd/integration/integration.go +++ b/cmd/integration/integration.go @@ -274,7 +274,7 @@ func makeTempDirOrDie(prefix string, baseDir string) string { func podsOnNodes(c *client.Client, podNamespace string, labelSelector labels.Selector) wait.ConditionFunc { // Wait until all pods are running on the node. return func() (bool, error) { - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}} + options := api.ListOptions{LabelSelector: labelSelector} pods, err := c.Pods(podNamespace).List(options) if err != nil { glog.Infof("Unable to get pods to list: %v", err) @@ -401,7 +401,7 @@ containers: namespace := kubetypes.NamespaceDefault if err := wait.Poll(time.Second, longTestTimeout, podRunning(c, namespace, podName)); err != nil { - if pods, err := c.Pods(namespace).List(unversioned.ListOptions{}); err == nil { + if pods, err := c.Pods(namespace).List(api.ListOptions{}); err == nil { for _, pod := range pods.Items { glog.Infof("pod found: %s/%s", namespace, pod.Name) } @@ -509,7 +509,7 @@ func runSelfLinkTestOnNamespace(c *client.Client, namespace string) { glog.Fatalf("Failed listing service with supplied self link '%v': %v", svc.SelfLink, err) } - svcList, err := services.List(unversioned.ListOptions{}) + svcList, err := services.List(api.ListOptions{}) if err != nil { glog.Fatalf("Failed listing services: %v", err) } @@ -730,7 +730,7 @@ func runPatchTest(c *client.Client) { func runMasterServiceTest(client *client.Client) { time.Sleep(12 * time.Second) - svcList, err := client.Services(api.NamespaceDefault).List(unversioned.ListOptions{}) + svcList, err := client.Services(api.NamespaceDefault).List(api.ListOptions{}) if err != nil { glog.Fatalf("Unexpected error listing services: %v", err) } @@ -857,7 +857,7 @@ func runServiceTest(client *client.Client) { glog.Fatalf("FAILED: service in other namespace should have no endpoints: %v", err) } - svcList, err := client.Services(api.NamespaceAll).List(unversioned.ListOptions{}) + svcList, err := client.Services(api.NamespaceAll).List(api.ListOptions{}) if err != nil { glog.Fatalf("Failed to list services across namespaces: %v", err) } diff --git a/contrib/mesos/pkg/executor/executor_test.go b/contrib/mesos/pkg/executor/executor_test.go index 494ce56052e..569b933e6ea 100644 --- a/contrib/mesos/pkg/executor/executor_test.go +++ b/contrib/mesos/pkg/executor/executor_test.go @@ -520,10 +520,10 @@ func NewMockPodsListWatch(initialPodList api.PodList) *MockPodsListWatch { list: initialPodList, } lw.ListWatch = cache.ListWatch{ - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return lw.fakeWatcher, nil }, - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return &lw.list, nil }, } diff --git a/contrib/mesos/pkg/scheduler/components/framework/framework.go b/contrib/mesos/pkg/scheduler/components/framework/framework.go index f91c36fdbdd..97eaaf3be90 100644 --- a/contrib/mesos/pkg/scheduler/components/framework/framework.go +++ b/contrib/mesos/pkg/scheduler/components/framework/framework.go @@ -43,7 +43,6 @@ import ( "k8s.io/kubernetes/contrib/mesos/pkg/scheduler/podtask" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/kubelet/container" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" @@ -650,7 +649,7 @@ func (k *framework) makeTaskRegistryReconciler() taskreconciler.Action { // tasks identified by annotations in the Kubernetes pod registry. func (k *framework) makePodRegistryReconciler() taskreconciler.Action { return taskreconciler.Action(func(drv bindings.SchedulerDriver, cancel <-chan struct{}) <-chan error { - podList, err := k.client.Pods(api.NamespaceAll).List(unversioned.ListOptions{}) + podList, err := k.client.Pods(api.NamespaceAll).List(api.ListOptions{}) if err != nil { return proc.ErrorChanf("failed to reconcile pod registry: %v", err) } @@ -726,7 +725,7 @@ func (k *framework) explicitlyReconcileTasks(driver bindings.SchedulerDriver, ta } func (ks *framework) recoverTasks() error { - podList, err := ks.client.Pods(api.NamespaceAll).List(unversioned.ListOptions{}) + podList, err := ks.client.Pods(api.NamespaceAll).List(api.ListOptions{}) if err != nil { log.V(1).Infof("failed to recover pod registry, madness may ensue: %v", err) return err diff --git a/contrib/mesos/pkg/scheduler/integration/integration_test.go b/contrib/mesos/pkg/scheduler/integration/integration_test.go index 05a383c35be..547992f80ee 100644 --- a/contrib/mesos/pkg/scheduler/integration/integration_test.go +++ b/contrib/mesos/pkg/scheduler/integration/integration_test.go @@ -170,10 +170,10 @@ func NewMockPodsListWatch(initialPodList api.PodList) *MockPodsListWatch { list: initialPodList, } lw.ListWatch = cache.ListWatch{ - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return lw.fakeWatcher, nil }, - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { lw.lock.Lock() defer lw.lock.Unlock() diff --git a/contrib/mesos/pkg/service/endpoints_controller.go b/contrib/mesos/pkg/service/endpoints_controller.go index 5ef0e19e1ba..a4c5cd565d3 100644 --- a/contrib/mesos/pkg/service/endpoints_controller.go +++ b/contrib/mesos/pkg/service/endpoints_controller.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/endpoints" "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" kservice "k8s.io/kubernetes/pkg/controller/endpoint" @@ -58,10 +57,10 @@ func NewEndpointController(client *client.Client) *endpointController { } e.serviceStore.Store, e.serviceController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return e.client.Services(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return e.client.Services(api.NamespaceAll).Watch(options) }, }, @@ -78,10 +77,10 @@ func NewEndpointController(client *client.Client) *endpointController { e.podStore.Store, e.podController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return e.client.Pods(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return e.client.Pods(api.NamespaceAll).Watch(options) }, }, @@ -385,7 +384,7 @@ func (e *endpointController) syncService(key string) { // some stragglers could have been left behind if the endpoint controller // reboots). func (e *endpointController) checkLeftoverEndpoints() { - list, err := e.client.Endpoints(api.NamespaceAll).List(unversioned.ListOptions{}) + list, err := e.client.Endpoints(api.NamespaceAll).List(api.ListOptions{}) if err != nil { glog.Errorf("Unable to list endpoints (%v); orphaned endpoints will not be cleaned up. (They're pretty harmless, but you can restart this component if you want another attempt made.)", err) return diff --git a/pkg/api/conversion.go b/pkg/api/conversion.go index e7c57d41373..9702b00ec20 100644 --- a/pkg/api/conversion.go +++ b/pkg/api/conversion.go @@ -31,6 +31,14 @@ var Codec = runtime.CodecFor(Scheme, "") func init() { Scheme.AddDefaultingFuncs( + func(obj *ListOptions) { + if obj.LabelSelector == nil { + obj.LabelSelector = labels.Everything() + } + if obj.FieldSelector == nil { + obj.FieldSelector = fields.Everything() + } + }, func(obj *unversioned.ListOptions) { if obj.LabelSelector.Selector == nil { obj.LabelSelector = unversioned.LabelSelector{labels.Everything()} diff --git a/pkg/api/register.go b/pkg/api/register.go index 8caa25a401e..a949be2ebbc 100644 --- a/pkg/api/register.go +++ b/pkg/api/register.go @@ -71,6 +71,7 @@ func init() { &PersistentVolumeClaim{}, &PersistentVolumeClaimList{}, &DeleteOptions{}, + &ListOptions{}, &PodAttachOptions{}, &PodLogOptions{}, &PodExecOptions{}, @@ -83,7 +84,6 @@ func init() { // Register Unversioned types // TODO this should not be done here - Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.ListOptions{}) Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.Status{}) Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.APIVersions{}) Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.APIGroupList{}) @@ -123,6 +123,7 @@ func (*PersistentVolumeList) IsAnAPIObject() {} func (*PersistentVolumeClaim) IsAnAPIObject() {} func (*PersistentVolumeClaimList) IsAnAPIObject() {} func (*DeleteOptions) IsAnAPIObject() {} +func (*ListOptions) IsAnAPIObject() {} func (*PodAttachOptions) IsAnAPIObject() {} func (*PodLogOptions) IsAnAPIObject() {} func (*PodExecOptions) IsAnAPIObject() {} diff --git a/pkg/api/testing/fuzzer.go b/pkg/api/testing/fuzzer.go index 914dd6978c2..8fa1065472c 100644 --- a/pkg/api/testing/fuzzer.go +++ b/pkg/api/testing/fuzzer.go @@ -97,6 +97,12 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() }, + func(j *api.ListOptions, c fuzz.Continue) { + label, _ := labels.Parse("a=b") + j.LabelSelector = label + field, _ := fields.ParseSelector("a=b") + j.FieldSelector = field + }, func(j *unversioned.ListOptions, c fuzz.Continue) { // TODO: add some parsing label, _ := labels.Parse("a=b") diff --git a/pkg/api/types.go b/pkg/api/types.go index 34d3e86cd1d..292458f5f6a 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -19,6 +19,8 @@ package api import ( "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/fields" + "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util/intstr" @@ -1647,6 +1649,23 @@ type DeleteOptions struct { GracePeriodSeconds *int64 `json:"gracePeriodSeconds"` } +// ListOptions is the query options to a standard REST list call, and has future support for +// watch calls. +type ListOptions struct { + unversioned.TypeMeta `json:",inline"` + + // A selector based on labels + LabelSelector labels.Selector + // A selector based on fields + FieldSelector fields.Selector + // If true, watch for changes to this list + Watch bool + // The resource version to watch (no effect on list yet) + ResourceVersion string + // Timeout for the list/watch call. + TimeoutSeconds *int64 +} + // PodLogOptions is the query options for a Pod's logs REST call type PodLogOptions struct { unversioned.TypeMeta diff --git a/pkg/apis/extensions/register.go b/pkg/apis/extensions/register.go index 8032b5b4c9f..f56dc7537c3 100644 --- a/pkg/apis/extensions/register.go +++ b/pkg/apis/extensions/register.go @@ -61,11 +61,8 @@ func addKnownTypes() { &ThirdPartyResourceDataList{}, &Ingress{}, &IngressList{}, + &api.ListOptions{}, ) - - // Register Unversioned types - // TODO this should not be done here - api.Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.ListOptions{}) } func (*ClusterAutoscaler) IsAnAPIObject() {} diff --git a/pkg/apis/extensions/v1beta1/register.go b/pkg/apis/extensions/v1beta1/register.go index 547283b3d71..583df8bd1bf 100644 --- a/pkg/apis/extensions/v1beta1/register.go +++ b/pkg/apis/extensions/v1beta1/register.go @@ -54,11 +54,8 @@ func addKnownTypes() { &ThirdPartyResourceDataList{}, &Ingress{}, &IngressList{}, + &ListOptions{}, ) - - // Register Unversioned types - // TODO this should not be done here - api.Scheme.AddKnownTypes(SchemeGroupVersion, &unversioned.ListOptions{}) } func (*ClusterAutoscaler) IsAnAPIObject() {} @@ -79,3 +76,4 @@ func (*ThirdPartyResourceData) IsAnAPIObject() {} func (*ThirdPartyResourceDataList) IsAnAPIObject() {} func (*Ingress) IsAnAPIObject() {} func (*IngressList) IsAnAPIObject() {} +func (*ListOptions) IsAnAPIObject() {} diff --git a/pkg/apis/extensions/v1beta1/types.go b/pkg/apis/extensions/v1beta1/types.go index 0a4465e8e2b..d41c252679b 100644 --- a/pkg/apis/extensions/v1beta1/types.go +++ b/pkg/apis/extensions/v1beta1/types.go @@ -663,6 +663,26 @@ type ClusterAutoscalerList struct { Items []ClusterAutoscaler `json:"items"` } +// ListOptions is the query options to a standard REST list call. +type ListOptions struct { + unversioned.TypeMeta `json:",inline"` + + // A selector to restrict the list of returned objects by their labels. + // Defaults to everything. + LabelSelector string `json:"labelSelector,omitempty"` + // A selector to restrict the list of returned objects by their fields. + // Defaults to everything. + FieldSelector string `json:"fieldSelector,omitempty"` + // Watch for changes to the described resources and return them as a stream of + // add, update, and remove notifications. Specify resourceVersion. + Watch bool `json:"watch,omitempty"` + // When specified with a watch call, shows changes that occur after that particular version of a resource. + // Defaults to changes from the beginning of history. + ResourceVersion string `json:"resourceVersion,omitempty"` + // Timeout for the list/watch call. + TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty"` +} + // A label selector is a label query over a set of resources. The result of matchLabels and // matchExpressions are ANDed. An empty label selector matches all objects. A null // label selector matches no objects. diff --git a/pkg/client/cache/listwatch.go b/pkg/client/cache/listwatch.go index 977b84cf5fe..20c3db5ea44 100644 --- a/pkg/client/cache/listwatch.go +++ b/pkg/client/cache/listwatch.go @@ -20,7 +20,6 @@ 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" "k8s.io/kubernetes/pkg/runtime" @@ -28,10 +27,10 @@ import ( ) // ListFunc knows how to list resources -type ListFunc func(options unversioned.ListOptions) (runtime.Object, error) +type ListFunc func(options api.ListOptions) (runtime.Object, error) // WatchFunc knows how to watch resources -type WatchFunc func(options unversioned.ListOptions) (watch.Interface, error) +type WatchFunc func(options api.ListOptions) (watch.Interface, error) // ListWatch knows how to list and watch a set of apiserver resources. It satisfies the ListerWatcher interface. // It is a convenience function for users of NewReflector, etc. @@ -48,7 +47,7 @@ type Getter interface { // NewListWatchFromClient creates a new ListWatch from the specified client, resource, namespace and field selector. func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSelector fields.Selector) *ListWatch { - listFunc := func(options unversioned.ListOptions) (runtime.Object, error) { + listFunc := func(options api.ListOptions) (runtime.Object, error) { return c.Get(). Namespace(namespace). Resource(resource). @@ -57,7 +56,7 @@ func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSe Do(). Get() } - watchFunc := func(options unversioned.ListOptions) (watch.Interface, error) { + watchFunc := func(options api.ListOptions) (watch.Interface, error) { return c.Get(). Prefix("watch"). Namespace(namespace). @@ -69,7 +68,7 @@ func NewListWatchFromClient(c Getter, resource string, namespace string, fieldSe return &ListWatch{ListFunc: listFunc, WatchFunc: watchFunc} } -func timeoutFromListOptions(options unversioned.ListOptions) time.Duration { +func timeoutFromListOptions(options api.ListOptions) time.Duration { if options.TimeoutSeconds != nil { return time.Duration(*options.TimeoutSeconds) * time.Second } @@ -77,11 +76,11 @@ func timeoutFromListOptions(options unversioned.ListOptions) time.Duration { } // List a set of apiserver resources -func (lw *ListWatch) List(options unversioned.ListOptions) (runtime.Object, error) { +func (lw *ListWatch) List(options api.ListOptions) (runtime.Object, error) { return lw.ListFunc(options) } // Watch a set of apiserver resources -func (lw *ListWatch) Watch(options unversioned.ListOptions) (watch.Interface, error) { +func (lw *ListWatch) Watch(options api.ListOptions) (watch.Interface, error) { return lw.WatchFunc(options) } diff --git a/pkg/client/cache/listwatch_test.go b/pkg/client/cache/listwatch_test.go index b66e5c5d04d..51a88df12eb 100644 --- a/pkg/client/cache/listwatch_test.go +++ b/pkg/client/cache/listwatch_test.go @@ -99,7 +99,7 @@ func TestListWatchesCanList(t *testing.T) { client := client.NewOrDie(&client.Config{Host: server.URL, GroupVersion: testapi.Default.GroupVersion()}) lw := NewListWatchFromClient(client, item.resource, item.namespace, item.fieldSelector) // This test merely tests that the correct request is made. - lw.List(unversioned.ListOptions{}) + lw.List(api.ListOptions{}) handler.ValidateRequest(t, item.location, "GET", nil) } } @@ -165,7 +165,7 @@ func TestListWatchesCanWatch(t *testing.T) { client := client.NewOrDie(&client.Config{Host: server.URL, GroupVersion: testapi.Default.GroupVersion()}) lw := NewListWatchFromClient(client, item.resource, item.namespace, item.fieldSelector) // This test merely tests that the correct request is made. - lw.Watch(unversioned.ListOptions{ResourceVersion: item.rv}) + lw.Watch(api.ListOptions{ResourceVersion: item.rv}) handler.ValidateRequest(t, item.location, "GET", nil) } } diff --git a/pkg/client/cache/reflector.go b/pkg/client/cache/reflector.go index 48e66d72b4b..7c1dd0d28e2 100644 --- a/pkg/client/cache/reflector.go +++ b/pkg/client/cache/reflector.go @@ -31,9 +31,9 @@ import ( "time" "github.com/golang/glog" + "k8s.io/kubernetes/pkg/api" apierrs "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/watch" @@ -43,9 +43,9 @@ import ( type ListerWatcher interface { // List should return a list type object; the Items field will be extracted, and the // ResourceVersion field will be used to start the watch in the right place. - List(options unversioned.ListOptions) (runtime.Object, error) + List(options api.ListOptions) (runtime.Object, error) // Watch should begin a watch at the specified version. - Watch(options unversioned.ListOptions) (watch.Interface, error) + Watch(options api.ListOptions) (watch.Interface, error) } // Reflector watches a specified resource and causes all changes to be reflected in the given store. @@ -230,7 +230,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { // Explicitly set "0" as resource version - it's fine for the List() // to be served from cache and potentially be delayed relative to // etcd contents. Reflector framework will catch up via Watch() eventually. - options := unversioned.ListOptions{ResourceVersion: "0"} + options := api.ListOptions{ResourceVersion: "0"} list, err := r.listerWatcher.List(options) if err != nil { return fmt.Errorf("%s: Failed to list %v: %v", r.name, r.expectedType, err) @@ -250,7 +250,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { r.setLastSyncResourceVersion(resourceVersion) for { - options := unversioned.ListOptions{ + options := api.ListOptions{ ResourceVersion: resourceVersion, // We want to avoid situations when resyncing is breaking the TCP connection // - see comment for 'timeoutForWatch()' for more details. diff --git a/pkg/client/cache/reflector_test.go b/pkg/client/cache/reflector_test.go index f053aed9deb..17c332ca37e 100644 --- a/pkg/client/cache/reflector_test.go +++ b/pkg/client/cache/reflector_test.go @@ -35,10 +35,10 @@ type testLW struct { WatchFunc func(resourceVersion string) (watch.Interface, error) } -func (t *testLW) List(options unversioned.ListOptions) (runtime.Object, error) { +func (t *testLW) List(options api.ListOptions) (runtime.Object, error) { return t.ListFunc() } -func (t *testLW) Watch(options unversioned.ListOptions) (watch.Interface, error) { +func (t *testLW) Watch(options api.ListOptions) (watch.Interface, error) { return t.WatchFunc(options.ResourceVersion) } diff --git a/pkg/client/unversioned/componentstatuses.go b/pkg/client/unversioned/componentstatuses.go index 86fe6100680..d63dfda82a9 100644 --- a/pkg/client/unversioned/componentstatuses.go +++ b/pkg/client/unversioned/componentstatuses.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" ) type ComponentStatusesInterface interface { @@ -27,11 +26,11 @@ type ComponentStatusesInterface interface { // ComponentStatusInterface contains methods to retrieve ComponentStatus type ComponentStatusInterface interface { - List(opts unversioned.ListOptions) (*api.ComponentStatusList, error) + List(opts api.ListOptions) (*api.ComponentStatusList, error) Get(name string) (*api.ComponentStatus, error) // TODO: It'd be nice to have watch support at some point - //Watch(opts unversioned.ListOptions) (watch.Interface, error) + //Watch(opts api.ListOptions) (watch.Interface, error) } // componentStatuses implements ComponentStatusesInterface @@ -43,7 +42,7 @@ func newComponentStatuses(c *Client) *componentStatuses { return &componentStatuses{c} } -func (c *componentStatuses) List(opts unversioned.ListOptions) (result *api.ComponentStatusList, err error) { +func (c *componentStatuses) List(opts api.ListOptions) (result *api.ComponentStatusList, err error) { result = &api.ComponentStatusList{} err = c.client.Get(). Resource("componentStatuses"). diff --git a/pkg/client/unversioned/daemon_sets.go b/pkg/client/unversioned/daemon_sets.go index f40ffb42c37..1aabba69a22 100644 --- a/pkg/client/unversioned/daemon_sets.go +++ b/pkg/client/unversioned/daemon_sets.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/watch" ) @@ -29,13 +28,13 @@ type DaemonSetsNamespacer interface { } type DaemonSetInterface interface { - List(opts unversioned.ListOptions) (*extensions.DaemonSetList, error) + List(opts api.ListOptions) (*extensions.DaemonSetList, error) Get(name string) (*extensions.DaemonSet, error) Create(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error) Update(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error) UpdateStatus(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error) Delete(name string) error - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // daemonSets implements DaemonsSetsNamespacer interface @@ -51,7 +50,7 @@ func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets { // Ensure statically that daemonSets implements DaemonSetsInterface. var _ DaemonSetInterface = &daemonSets{} -func (c *daemonSets) List(opts unversioned.ListOptions) (result *extensions.DaemonSetList, err error) { +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) return @@ -91,7 +90,7 @@ func (c *daemonSets) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested daemon sets. -func (c *daemonSets) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *daemonSets) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/daemon_sets_test.go b/pkg/client/unversioned/daemon_sets_test.go index 939b0637d60..cf187e547cc 100644 --- a/pkg/client/unversioned/daemon_sets_test.go +++ b/pkg/client/unversioned/daemon_sets_test.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" ) @@ -60,7 +59,7 @@ func TestListDaemonSets(t *testing.T) { }, }, } - receivedDSs, err := c.Setup(t).Extensions().DaemonSets(ns).List(unversioned.ListOptions{}) + receivedDSs, err := c.Setup(t).Extensions().DaemonSets(ns).List(api.ListOptions{}) c.Validate(t, receivedDSs, err) } diff --git a/pkg/client/unversioned/deployment.go b/pkg/client/unversioned/deployment.go index 0b94112c5ab..cf84b19fc72 100644 --- a/pkg/client/unversioned/deployment.go +++ b/pkg/client/unversioned/deployment.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/watch" ) @@ -30,13 +29,13 @@ type DeploymentsNamespacer interface { // DeploymentInterface has methods to work with Deployment resources. type DeploymentInterface interface { - List(opts unversioned.ListOptions) (*extensions.DeploymentList, error) + List(opts api.ListOptions) (*extensions.DeploymentList, error) Get(name string) (*extensions.Deployment, error) Delete(name string, options *api.DeleteOptions) error Create(*extensions.Deployment) (*extensions.Deployment, error) Update(*extensions.Deployment) (*extensions.Deployment, error) UpdateStatus(*extensions.Deployment) (*extensions.Deployment, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // deployments implements DeploymentInterface @@ -54,7 +53,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 unversioned.ListOptions) (result *extensions.DeploymentList, err error) { +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) return @@ -100,7 +99,7 @@ func (c *deployments) UpdateStatus(deployment *extensions.Deployment) (result *e } // Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *deployments) Watch(opts api.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/deployment_test.go b/pkg/client/unversioned/deployment_test.go index c6345cd144c..5cca6f51a1f 100644 --- a/pkg/client/unversioned/deployment_test.go +++ b/pkg/client/unversioned/deployment_test.go @@ -105,7 +105,7 @@ func TestDeploymentList(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: deploymentList}, } - response, err := c.Setup(t).Deployments(ns).List(unversioned.ListOptions{}) + response, err := c.Setup(t).Deployments(ns).List(api.ListOptions{}) c.Validate(t, response, err) } @@ -174,7 +174,7 @@ func TestDeploymentWatch(t *testing.T) { }, Response: simple.Response{StatusCode: 200}, } - _, err := c.Setup(t).Deployments(api.NamespaceAll).Watch(unversioned.ListOptions{}) + _, err := c.Setup(t).Deployments(api.NamespaceAll).Watch(api.ListOptions{}) c.Validate(t, nil, err) } @@ -205,7 +205,7 @@ func TestListDeploymentsLabels(t *testing.T) { c.Setup(t) c.QueryValidator[labelSelectorQueryParamName] = simple.ValidateLabels selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} receivedPodList, err := c.Deployments(ns).List(options) c.Validate(t, receivedPodList, err) } diff --git a/pkg/client/unversioned/endpoints.go b/pkg/client/unversioned/endpoints.go index f5d3237d33b..24993efda23 100644 --- a/pkg/client/unversioned/endpoints.go +++ b/pkg/client/unversioned/endpoints.go @@ -20,7 +20,6 @@ import ( "fmt" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -32,11 +31,11 @@ type EndpointsNamespacer interface { // EndpointsInterface has methods to work with Endpoints resources type EndpointsInterface interface { Create(endpoints *api.Endpoints) (*api.Endpoints, error) - List(opts unversioned.ListOptions) (*api.EndpointsList, error) + List(opts api.ListOptions) (*api.EndpointsList, error) Get(name string) (*api.Endpoints, error) Delete(name string) error Update(endpoints *api.Endpoints) (*api.Endpoints, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // endpoints implements EndpointsInterface @@ -58,7 +57,7 @@ func (c *endpoints) Create(endpoints *api.Endpoints) (*api.Endpoints, error) { } // List takes a selector, and returns the list of endpoints that match that selector -func (c *endpoints) List(opts unversioned.ListOptions) (result *api.EndpointsList, err error) { +func (c *endpoints) List(opts api.ListOptions) (result *api.EndpointsList, err error) { result = &api.EndpointsList{} err = c.r.Get(). Namespace(c.ns). @@ -82,7 +81,7 @@ func (c *endpoints) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested endpoints for a service. -func (c *endpoints) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *endpoints) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/endpoints_test.go b/pkg/client/unversioned/endpoints_test.go index 322b89224a9..2676c9a81e4 100644 --- a/pkg/client/unversioned/endpoints_test.go +++ b/pkg/client/unversioned/endpoints_test.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" ) func TestListEndpoints(t *testing.T) { @@ -47,7 +46,7 @@ func TestListEndpoints(t *testing.T) { }, }, } - receivedEndpointsList, err := c.Setup(t).Endpoints(ns).List(unversioned.ListOptions{}) + receivedEndpointsList, err := c.Setup(t).Endpoints(ns).List(api.ListOptions{}) c.Validate(t, receivedEndpointsList, err) } diff --git a/pkg/client/unversioned/events.go b/pkg/client/unversioned/events.go index 3e343134924..8935efcccf7 100644 --- a/pkg/client/unversioned/events.go +++ b/pkg/client/unversioned/events.go @@ -20,7 +20,6 @@ import ( "fmt" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/watch" @@ -36,14 +35,14 @@ type EventInterface interface { Create(event *api.Event) (*api.Event, error) Update(event *api.Event) (*api.Event, error) Patch(event *api.Event, data []byte) (*api.Event, error) - List(opts unversioned.ListOptions) (*api.EventList, error) + List(opts api.ListOptions) (*api.EventList, error) Get(name string) (*api.Event, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) // Search finds events about the specified object Search(objOrRef runtime.Object) (*api.EventList, error) Delete(name string) error // DeleteCollection deletes a collection of events. - DeleteCollection(options *api.DeleteOptions, listOptions unversioned.ListOptions) error + DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) 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. GetFieldSelector(involvedObjectName, involvedObjectNamespace, involvedObjectKind, involvedObjectUID *string) fields.Selector @@ -118,7 +117,7 @@ func (e *events) Patch(incompleteEvent *api.Event, data []byte) (*api.Event, err } // List returns a list of events matching the selectors. -func (e *events) List(opts unversioned.ListOptions) (*api.EventList, error) { +func (e *events) List(opts api.ListOptions) (*api.EventList, error) { result := &api.EventList{} err := e.client.Get(). NamespaceIfScoped(e.namespace, len(e.namespace) > 0). @@ -142,7 +141,7 @@ func (e *events) Get(name string) (*api.Event, error) { } // Watch starts watching for events matching the given selectors. -func (e *events) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (e *events) Watch(opts api.ListOptions) (watch.Interface, error) { return e.client.Get(). Prefix("watch"). NamespaceIfScoped(e.namespace, len(e.namespace) > 0). @@ -173,7 +172,7 @@ func (e *events) Search(objOrRef runtime.Object) (*api.EventList, error) { refUID = &stringRefUID } fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID) - return e.List(unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{fieldSelector}}) + return e.List(api.ListOptions{FieldSelector: fieldSelector}) } // Delete deletes an existing event. @@ -187,7 +186,7 @@ func (e *events) Delete(name string) error { } // DeleteCollection deletes a collection of objects. -func (e *events) DeleteCollection(options *api.DeleteOptions, listOptions unversioned.ListOptions) error { +func (e *events) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { // TODO: to make this reusable in other client libraries if options == nil { return e.client.Delete(). diff --git a/pkg/client/unversioned/events_test.go b/pkg/client/unversioned/events_test.go index 5bca3433a2c..3a6cbec5835 100644 --- a/pkg/client/unversioned/events_test.go +++ b/pkg/client/unversioned/events_test.go @@ -169,7 +169,7 @@ func TestEventList(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: eventList}, } - response, err := c.Setup(t).Events(ns).List(unversioned.ListOptions{}) + response, err := c.Setup(t).Events(ns).List(api.ListOptions{}) if err != nil { t.Errorf("%#v should be nil.", err) diff --git a/pkg/client/unversioned/horizontalpodautoscaler.go b/pkg/client/unversioned/horizontalpodautoscaler.go index fe82ddc9958..f279f3c1004 100644 --- a/pkg/client/unversioned/horizontalpodautoscaler.go +++ b/pkg/client/unversioned/horizontalpodautoscaler.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/watch" ) @@ -30,13 +29,13 @@ type HorizontalPodAutoscalersNamespacer interface { // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. type HorizontalPodAutoscalerInterface interface { - List(opts unversioned.ListOptions) (*extensions.HorizontalPodAutoscalerList, error) + List(opts api.ListOptions) (*extensions.HorizontalPodAutoscalerList, error) Get(name string) (*extensions.HorizontalPodAutoscaler, error) Delete(name string, options *api.DeleteOptions) error Create(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) Update(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) UpdateStatus(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // horizontalPodAutoscalers implements HorizontalPodAutoscalersNamespacer interface @@ -54,7 +53,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 unversioned.ListOptions) (result *extensions.HorizontalPodAutoscalerList, err error) { +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) return @@ -102,7 +101,7 @@ func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *extensi } // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *horizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/horizontalpodautoscaler_test.go b/pkg/client/unversioned/horizontalpodautoscaler_test.go index 4c3f0e3b67f..f811f370f10 100644 --- a/pkg/client/unversioned/horizontalpodautoscaler_test.go +++ b/pkg/client/unversioned/horizontalpodautoscaler_test.go @@ -27,7 +27,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" ) @@ -103,7 +102,7 @@ func TestHorizontalPodAutoscalerList(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: horizontalPodAutoscalerList}, } - response, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(ns).List(unversioned.ListOptions{}) + response, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(ns).List(api.ListOptions{}) c.Validate(t, response, err) } @@ -159,6 +158,6 @@ func TestHorizontalPodAutoscalerWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: simple.Response{StatusCode: 200}, } - _, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(api.NamespaceAll).Watch(unversioned.ListOptions{}) + _, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(api.NamespaceAll).Watch(api.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/ingress.go b/pkg/client/unversioned/ingress.go index 2c273f21ff5..a9bfc5a9594 100644 --- a/pkg/client/unversioned/ingress.go +++ b/pkg/client/unversioned/ingress.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/watch" ) @@ -30,12 +29,12 @@ type IngressNamespacer interface { // IngressInterface exposes methods to work on Ingress resources. type IngressInterface interface { - List(opts unversioned.ListOptions) (*extensions.IngressList, error) + List(opts api.ListOptions) (*extensions.IngressList, error) Get(name string) (*extensions.Ingress, error) Create(ingress *extensions.Ingress) (*extensions.Ingress, error) Update(ingress *extensions.Ingress) (*extensions.Ingress, error) Delete(name string, options *api.DeleteOptions) error - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) UpdateStatus(ingress *extensions.Ingress) (*extensions.Ingress, error) } @@ -51,7 +50,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 unversioned.ListOptions) (result *extensions.IngressList, err error) { +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) return @@ -92,7 +91,7 @@ func (c *ingress) Delete(name string, options *api.DeleteOptions) (err error) { } // Watch returns a watch.Interface that watches the requested ingress. -func (c *ingress) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *ingress) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/ingress_test.go b/pkg/client/unversioned/ingress_test.go index 6aeea9d4d36..281b0561432 100644 --- a/pkg/client/unversioned/ingress_test.go +++ b/pkg/client/unversioned/ingress_test.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" ) @@ -60,7 +59,7 @@ func TestListIngress(t *testing.T) { }, }, } - receivedIngressList, err := c.Setup(t).Extensions().Ingress(ns).List(unversioned.ListOptions{}) + receivedIngressList, err := c.Setup(t).Extensions().Ingress(ns).List(api.ListOptions{}) c.Validate(t, receivedIngressList, err) } diff --git a/pkg/client/unversioned/jobs.go b/pkg/client/unversioned/jobs.go index 4840c7766c7..5ca8909c650 100644 --- a/pkg/client/unversioned/jobs.go +++ b/pkg/client/unversioned/jobs.go @@ -19,7 +19,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/latest" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/watch" ) @@ -31,12 +30,12 @@ type JobsNamespacer interface { // JobInterface exposes methods to work on Job resources. type JobInterface interface { - List(opts unversioned.ListOptions) (*extensions.JobList, error) + List(opts api.ListOptions) (*extensions.JobList, error) Get(name string) (*extensions.Job, error) Create(job *extensions.Job) (*extensions.Job, error) Update(job *extensions.Job) (*extensions.Job, error) Delete(name string, options *api.DeleteOptions) error - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) UpdateStatus(job *extensions.Job) (*extensions.Job, error) } @@ -55,7 +54,7 @@ func newJobs(c *ExtensionsClient, namespace string) *jobs { var _ JobInterface = &jobs{} // List returns a list of jobs that match the label and field selectors. -func (c *jobs) List(opts unversioned.ListOptions) (result *extensions.JobList, err error) { +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) return @@ -96,7 +95,7 @@ func (c *jobs) Delete(name string, options *api.DeleteOptions) (err error) { } // Watch returns a watch.Interface that watches the requested jobs. -func (c *jobs) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *jobs) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/jobs_test.go b/pkg/client/unversioned/jobs_test.go index 2268d404e26..4c55f933900 100644 --- a/pkg/client/unversioned/jobs_test.go +++ b/pkg/client/unversioned/jobs_test.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" ) @@ -60,7 +59,7 @@ func TestListJobs(t *testing.T) { }, }, } - receivedJobList, err := c.Setup(t).Extensions().Jobs(ns).List(unversioned.ListOptions{}) + receivedJobList, err := c.Setup(t).Extensions().Jobs(ns).List(api.ListOptions{}) c.Validate(t, receivedJobList, err) } diff --git a/pkg/client/unversioned/limit_ranges.go b/pkg/client/unversioned/limit_ranges.go index 38b8b1db28b..6820e2c22f5 100644 --- a/pkg/client/unversioned/limit_ranges.go +++ b/pkg/client/unversioned/limit_ranges.go @@ -20,7 +20,6 @@ import ( "fmt" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -31,12 +30,12 @@ type LimitRangesNamespacer interface { // LimitRangeInterface has methods to work with LimitRange resources. type LimitRangeInterface interface { - List(opts unversioned.ListOptions) (*api.LimitRangeList, error) + List(opts api.ListOptions) (*api.LimitRangeList, error) Get(name string) (*api.LimitRange, error) Delete(name string) error Create(limitRange *api.LimitRange) (*api.LimitRange, error) Update(limitRange *api.LimitRange) (*api.LimitRange, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // limitRanges implements LimitRangesNamespacer interface @@ -54,7 +53,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 unversioned.ListOptions) (result *api.LimitRangeList, err error) { +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) return @@ -91,7 +90,7 @@ func (c *limitRanges) Update(limitRange *api.LimitRange) (result *api.LimitRange } // Watch returns a watch.Interface that watches the requested resource -func (c *limitRanges) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *limitRanges) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/limit_ranges_test.go b/pkg/client/unversioned/limit_ranges_test.go index 79b45098e81..1c76437439c 100644 --- a/pkg/client/unversioned/limit_ranges_test.go +++ b/pkg/client/unversioned/limit_ranges_test.go @@ -28,7 +28,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" ) func getLimitRangesResourceName() string { @@ -126,7 +125,7 @@ func TestLimitRangeList(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: limitRangeList}, } - response, err := c.Setup(t).LimitRanges(ns).List(unversioned.ListOptions{}) + response, err := c.Setup(t).LimitRanges(ns).List(api.ListOptions{}) c.Validate(t, response, err) } @@ -211,6 +210,6 @@ func TestLimitRangeWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: simple.Response{StatusCode: 200}, } - _, err := c.Setup(t).LimitRanges(api.NamespaceAll).Watch(unversioned.ListOptions{}) + _, err := c.Setup(t).LimitRanges(api.NamespaceAll).Watch(api.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/namespaces.go b/pkg/client/unversioned/namespaces.go index fe9b3e5420e..9b669f7cd34 100644 --- a/pkg/client/unversioned/namespaces.go +++ b/pkg/client/unversioned/namespaces.go @@ -20,7 +20,6 @@ import ( "fmt" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -31,10 +30,10 @@ type NamespacesInterface interface { type NamespaceInterface interface { Create(item *api.Namespace) (*api.Namespace, error) Get(name string) (result *api.Namespace, err error) - List(opts unversioned.ListOptions) (*api.NamespaceList, error) + List(opts api.ListOptions) (*api.NamespaceList, error) Delete(name string) error Update(item *api.Namespace) (*api.Namespace, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) Finalize(item *api.Namespace) (*api.Namespace, error) Status(item *api.Namespace) (*api.Namespace, error) } @@ -57,7 +56,7 @@ func (c *namespaces) Create(namespace *api.Namespace) (*api.Namespace, error) { } // List lists all the namespaces in the cluster. -func (c *namespaces) List(opts unversioned.ListOptions) (*api.NamespaceList, error) { +func (c *namespaces) List(opts api.ListOptions) (*api.NamespaceList, error) { result := &api.NamespaceList{} err := c.r.Get(). Resource("namespaces"). @@ -112,7 +111,7 @@ func (c *namespaces) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested namespaces. -func (c *namespaces) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *namespaces) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Resource("namespaces"). diff --git a/pkg/client/unversioned/namespaces_test.go b/pkg/client/unversioned/namespaces_test.go index 33b600a6c0a..b3239e3df22 100644 --- a/pkg/client/unversioned/namespaces_test.go +++ b/pkg/client/unversioned/namespaces_test.go @@ -27,7 +27,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" ) func TestNamespaceCreate(t *testing.T) { @@ -96,7 +95,7 @@ func TestNamespaceList(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: namespaceList}, } - response, err := c.Setup(t).Namespaces().List(unversioned.ListOptions{}) + response, err := c.Setup(t).Namespaces().List(api.ListOptions{}) if err != nil { t.Errorf("%#v should be nil.", err) @@ -178,6 +177,6 @@ func TestNamespaceWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: simple.Response{StatusCode: 200}, } - _, err := c.Setup(t).Namespaces().Watch(unversioned.ListOptions{}) + _, err := c.Setup(t).Namespaces().Watch(api.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/nodes.go b/pkg/client/unversioned/nodes.go index dde08078290..12570425de4 100644 --- a/pkg/client/unversioned/nodes.go +++ b/pkg/client/unversioned/nodes.go @@ -20,7 +20,6 @@ import ( "fmt" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -31,11 +30,11 @@ type NodesInterface interface { type NodeInterface interface { Get(name string) (result *api.Node, err error) Create(node *api.Node) (*api.Node, error) - List(opts unversioned.ListOptions) (*api.NodeList, error) + List(opts api.ListOptions) (*api.NodeList, error) Delete(name string) error Update(*api.Node) (*api.Node, error) UpdateStatus(*api.Node) (*api.Node, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // nodes implements NodesInterface @@ -61,7 +60,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 unversioned.ListOptions) (*api.NodeList, error) { +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) return result, err @@ -101,7 +100,7 @@ func (c *nodes) UpdateStatus(node *api.Node) (*api.Node, error) { } // Watch returns a watch.Interface that watches the requested nodes. -func (c *nodes) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *nodes) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(api.NamespaceAll). diff --git a/pkg/client/unversioned/nodes_test.go b/pkg/client/unversioned/nodes_test.go index fd68e134ca9..91c8946b67c 100644 --- a/pkg/client/unversioned/nodes_test.go +++ b/pkg/client/unversioned/nodes_test.go @@ -44,7 +44,7 @@ func TestListNodes(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: &api.NodeList{ListMeta: unversioned.ListMeta{ResourceVersion: "1"}}}, } - response, err := c.Setup(t).Nodes().List(unversioned.ListOptions{}) + response, err := c.Setup(t).Nodes().List(api.ListOptions{}) c.Validate(t, response, err) } @@ -74,7 +74,7 @@ func TestListNodesLabels(t *testing.T) { c.Setup(t) c.QueryValidator[labelSelectorQueryParamName] = simple.ValidateLabels selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} receivedNodeList, err := c.Nodes().List(options) c.Validate(t, receivedNodeList, err) } diff --git a/pkg/client/unversioned/persistentvolume_test.go b/pkg/client/unversioned/persistentvolume_test.go index ade0d7ed995..c244eaef0d5 100644 --- a/pkg/client/unversioned/persistentvolume_test.go +++ b/pkg/client/unversioned/persistentvolume_test.go @@ -28,7 +28,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" ) func getPersistentVolumesResoureName() string { @@ -110,7 +109,7 @@ func TestPersistentVolumeList(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: persistentVolumeList}, } - response, err := c.Setup(t).PersistentVolumes().List(unversioned.ListOptions{}) + response, err := c.Setup(t).PersistentVolumes().List(api.ListOptions{}) c.Validate(t, response, err) } @@ -184,6 +183,6 @@ func TestPersistentVolumeWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: simple.Response{StatusCode: 200}, } - _, err := c.Setup(t).PersistentVolumes().Watch(unversioned.ListOptions{}) + _, err := c.Setup(t).PersistentVolumes().Watch(api.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/persistentvolumeclaim.go b/pkg/client/unversioned/persistentvolumeclaim.go index 38f9b38afb8..4764e42b052 100644 --- a/pkg/client/unversioned/persistentvolumeclaim.go +++ b/pkg/client/unversioned/persistentvolumeclaim.go @@ -20,7 +20,6 @@ import ( "fmt" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -31,13 +30,13 @@ type PersistentVolumeClaimsNamespacer interface { // PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources. type PersistentVolumeClaimInterface interface { - List(opts unversioned.ListOptions) (*api.PersistentVolumeClaimList, error) + List(opts api.ListOptions) (*api.PersistentVolumeClaimList, error) Get(name string) (*api.PersistentVolumeClaim, error) Create(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) Update(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) UpdateStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) Delete(name string) error - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // persistentVolumeClaims implements PersistentVolumeClaimsNamespacer interface @@ -51,7 +50,7 @@ func newPersistentVolumeClaims(c *Client, namespace string) *persistentVolumeCla return &persistentVolumeClaims{c, namespace} } -func (c *persistentVolumeClaims) List(opts unversioned.ListOptions) (result *api.PersistentVolumeClaimList, err error) { +func (c *persistentVolumeClaims) List(opts api.ListOptions) (result *api.PersistentVolumeClaimList, err error) { result = &api.PersistentVolumeClaimList{} err = c.client.Get(). @@ -96,7 +95,7 @@ func (c *persistentVolumeClaims) Delete(name string) error { return c.client.Delete().Namespace(c.namespace).Resource("persistentVolumeClaims").Name(name).Do().Error() } -func (c *persistentVolumeClaims) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *persistentVolumeClaims) Watch(opts api.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Namespace(c.namespace). diff --git a/pkg/client/unversioned/persistentvolumeclaim_test.go b/pkg/client/unversioned/persistentvolumeclaim_test.go index ad004513f99..9747d567ad5 100644 --- a/pkg/client/unversioned/persistentvolumeclaim_test.go +++ b/pkg/client/unversioned/persistentvolumeclaim_test.go @@ -28,7 +28,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" ) func getPersistentVolumeClaimsResoureName() string { @@ -119,7 +118,7 @@ func TestPersistentVolumeClaimList(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: persistentVolumeList}, } - response, err := c.Setup(t).PersistentVolumeClaims(ns).List(unversioned.ListOptions{}) + response, err := c.Setup(t).PersistentVolumeClaims(ns).List(api.ListOptions{}) c.Validate(t, response, err) } @@ -201,6 +200,6 @@ func TestPersistentVolumeClaimWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: simple.Response{StatusCode: 200}, } - _, err := c.Setup(t).PersistentVolumeClaims(api.NamespaceAll).Watch(unversioned.ListOptions{}) + _, err := c.Setup(t).PersistentVolumeClaims(api.NamespaceAll).Watch(api.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/persistentvolumes.go b/pkg/client/unversioned/persistentvolumes.go index 71371c942fc..c9f735c8b31 100644 --- a/pkg/client/unversioned/persistentvolumes.go +++ b/pkg/client/unversioned/persistentvolumes.go @@ -20,7 +20,6 @@ import ( "fmt" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -30,13 +29,13 @@ type PersistentVolumesInterface interface { // PersistentVolumeInterface has methods to work with PersistentVolume resources. type PersistentVolumeInterface interface { - List(opts unversioned.ListOptions) (*api.PersistentVolumeList, error) + List(opts api.ListOptions) (*api.PersistentVolumeList, error) Get(name string) (*api.PersistentVolume, error) Create(volume *api.PersistentVolume) (*api.PersistentVolume, error) Update(volume *api.PersistentVolume) (*api.PersistentVolume, error) UpdateStatus(persistentVolume *api.PersistentVolume) (*api.PersistentVolume, error) Delete(name string) error - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // persistentVolumes implements PersistentVolumesInterface @@ -48,7 +47,7 @@ func newPersistentVolumes(c *Client) *persistentVolumes { return &persistentVolumes{c} } -func (c *persistentVolumes) List(opts unversioned.ListOptions) (result *api.PersistentVolumeList, err error) { +func (c *persistentVolumes) List(opts api.ListOptions) (result *api.PersistentVolumeList, err error) { result = &api.PersistentVolumeList{} err = c.client.Get(). Resource("persistentVolumes"). @@ -91,7 +90,7 @@ func (c *persistentVolumes) Delete(name string) error { return c.client.Delete().Resource("persistentVolumes").Name(name).Do().Error() } -func (c *persistentVolumes) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *persistentVolumes) Watch(opts api.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Resource("persistentVolumes"). diff --git a/pkg/client/unversioned/pod_templates.go b/pkg/client/unversioned/pod_templates.go index 18c6b37c094..f26d3333ed4 100644 --- a/pkg/client/unversioned/pod_templates.go +++ b/pkg/client/unversioned/pod_templates.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -29,12 +28,12 @@ type PodTemplatesNamespacer interface { // PodTemplateInterface has methods to work with PodTemplate resources. type PodTemplateInterface interface { - List(opts unversioned.ListOptions) (*api.PodTemplateList, error) + List(opts api.ListOptions) (*api.PodTemplateList, error) Get(name string) (*api.PodTemplate, error) Delete(name string, options *api.DeleteOptions) error Create(podTemplate *api.PodTemplate) (*api.PodTemplate, error) Update(podTemplate *api.PodTemplate) (*api.PodTemplate, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // podTemplates implements PodTemplatesNamespacer interface @@ -52,7 +51,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 unversioned.ListOptions) (result *api.PodTemplateList, err error) { +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) return @@ -93,7 +92,7 @@ func (c *podTemplates) Update(podTemplate *api.PodTemplate) (result *api.PodTemp } // Watch returns a watch.Interface that watches the requested podTemplates. -func (c *podTemplates) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *podTemplates) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/pod_templates_test.go b/pkg/client/unversioned/pod_templates_test.go index f454adb7179..8850033de17 100644 --- a/pkg/client/unversioned/pod_templates_test.go +++ b/pkg/client/unversioned/pod_templates_test.go @@ -27,7 +27,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" ) func getPodTemplatesResoureName() string { @@ -101,7 +100,7 @@ func TestPodTemplateList(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: podTemplateList}, } - response, err := c.Setup(t).PodTemplates(ns).List(unversioned.ListOptions{}) + response, err := c.Setup(t).PodTemplates(ns).List(api.ListOptions{}) c.Validate(t, response, err) } @@ -141,6 +140,6 @@ func TestPodTemplateWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: simple.Response{StatusCode: 200}, } - _, err := c.Setup(t).PodTemplates(api.NamespaceAll).Watch(unversioned.ListOptions{}) + _, err := c.Setup(t).PodTemplates(api.NamespaceAll).Watch(api.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/pods.go b/pkg/client/unversioned/pods.go index 5fbe2471a24..7d01c1bc0f4 100644 --- a/pkg/client/unversioned/pods.go +++ b/pkg/client/unversioned/pods.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -29,12 +28,12 @@ type PodsNamespacer interface { // PodInterface has methods to work with Pod resources. type PodInterface interface { - List(opts unversioned.ListOptions) (*api.PodList, error) + List(opts api.ListOptions) (*api.PodList, error) Get(name string) (*api.Pod, error) Delete(name string, options *api.DeleteOptions) error Create(pod *api.Pod) (*api.Pod, error) Update(pod *api.Pod) (*api.Pod, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) Bind(binding *api.Binding) error UpdateStatus(pod *api.Pod) (*api.Pod, error) GetLogs(name string, opts *api.PodLogOptions) *Request @@ -55,7 +54,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 unversioned.ListOptions) (result *api.PodList, err error) { +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) return @@ -96,7 +95,7 @@ func (c *pods) Update(pod *api.Pod) (result *api.Pod, err error) { } // Watch returns a watch.Interface that watches the requested pods. -func (c *pods) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *pods) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/pods_test.go b/pkg/client/unversioned/pods_test.go index 4c4666d1b3d..8da0d862710 100644 --- a/pkg/client/unversioned/pods_test.go +++ b/pkg/client/unversioned/pods_test.go @@ -36,7 +36,7 @@ func TestListEmptyPods(t *testing.T) { Request: simple.Request{Method: "GET", Path: testapi.Default.ResourcePath("pods", ns, ""), Query: simple.BuildQueryValues(nil)}, Response: simple.Response{StatusCode: http.StatusOK, Body: &api.PodList{}}, } - podList, err := c.Setup(t).Pods(ns).List(unversioned.ListOptions{}) + podList, err := c.Setup(t).Pods(ns).List(api.ListOptions{}) c.Validate(t, podList, err) } @@ -62,7 +62,7 @@ func TestListPods(t *testing.T) { }, }, } - receivedPodList, err := c.Setup(t).Pods(ns).List(unversioned.ListOptions{}) + receivedPodList, err := c.Setup(t).Pods(ns).List(api.ListOptions{}) c.Validate(t, receivedPodList, err) } @@ -96,7 +96,7 @@ func TestListPodsLabels(t *testing.T) { c.Setup(t) c.QueryValidator[labelSelectorQueryParamName] = simple.ValidateLabels selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} receivedPodList, err := c.Pods(ns).List(options) c.Validate(t, receivedPodList, err) } diff --git a/pkg/client/unversioned/replication_controllers.go b/pkg/client/unversioned/replication_controllers.go index b1f923e7ebc..828a47ce6ea 100644 --- a/pkg/client/unversioned/replication_controllers.go +++ b/pkg/client/unversioned/replication_controllers.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -29,13 +28,13 @@ type ReplicationControllersNamespacer interface { // ReplicationControllerInterface has methods to work with ReplicationController resources. type ReplicationControllerInterface interface { - List(opts unversioned.ListOptions) (*api.ReplicationControllerList, error) + List(opts api.ListOptions) (*api.ReplicationControllerList, error) Get(name string) (*api.ReplicationController, error) Create(ctrl *api.ReplicationController) (*api.ReplicationController, error) Update(ctrl *api.ReplicationController) (*api.ReplicationController, error) UpdateStatus(ctrl *api.ReplicationController) (*api.ReplicationController, error) Delete(name string) error - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // replicationControllers implements ReplicationControllersNamespacer interface @@ -50,7 +49,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 unversioned.ListOptions) (result *api.ReplicationControllerList, err error) { +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) return @@ -90,7 +89,7 @@ func (c *replicationControllers) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested controllers. -func (c *replicationControllers) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *replicationControllers) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/replication_controllers_test.go b/pkg/client/unversioned/replication_controllers_test.go index bb81591275d..84ee306097c 100644 --- a/pkg/client/unversioned/replication_controllers_test.go +++ b/pkg/client/unversioned/replication_controllers_test.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" ) func getRCResourceName() string { @@ -60,7 +59,7 @@ func TestListControllers(t *testing.T) { }, }, } - receivedControllerList, err := c.Setup(t).ReplicationControllers(ns).List(unversioned.ListOptions{}) + receivedControllerList, err := c.Setup(t).ReplicationControllers(ns).List(api.ListOptions{}) c.Validate(t, receivedControllerList, err) } diff --git a/pkg/client/unversioned/request_test.go b/pkg/client/unversioned/request_test.go index bc0e02062c0..e82bd57049f 100644 --- a/pkg/client/unversioned/request_test.go +++ b/pkg/client/unversioned/request_test.go @@ -195,7 +195,7 @@ func TestRequestVersionedParams(t *testing.T) { func TestRequestVersionedParamsFromListOptions(t *testing.T) { r := &Request{groupVersion: v1.SchemeGroupVersion} - r.VersionedParams(&unversioned.ListOptions{ResourceVersion: "1"}, api.Scheme) + r.VersionedParams(&api.ListOptions{ResourceVersion: "1"}, api.Scheme) if !reflect.DeepEqual(r.params, url.Values{ "resourceVersion": []string{"1"}, }) { @@ -203,7 +203,7 @@ func TestRequestVersionedParamsFromListOptions(t *testing.T) { } var timeout int64 = 10 - r.VersionedParams(&unversioned.ListOptions{ResourceVersion: "2", TimeoutSeconds: &timeout}, api.Scheme) + r.VersionedParams(&api.ListOptions{ResourceVersion: "2", TimeoutSeconds: &timeout}, api.Scheme) 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 75729d9a03d..1eed04d018b 100644 --- a/pkg/client/unversioned/resource_quotas.go +++ b/pkg/client/unversioned/resource_quotas.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -29,13 +28,13 @@ type ResourceQuotasNamespacer interface { // ResourceQuotaInterface has methods to work with ResourceQuota resources. type ResourceQuotaInterface interface { - List(opts unversioned.ListOptions) (*api.ResourceQuotaList, error) + List(opts api.ListOptions) (*api.ResourceQuotaList, error) Get(name string) (*api.ResourceQuota, error) Delete(name string) error Create(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) Update(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // resourceQuotas implements ResourceQuotasNamespacer interface @@ -53,7 +52,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 unversioned.ListOptions) (result *api.ResourceQuotaList, err error) { +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) return @@ -93,7 +92,7 @@ func (c *resourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (result } // Watch returns a watch.Interface that watches the requested resource -func (c *resourceQuotas) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *resourceQuotas) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/resource_quotas_test.go b/pkg/client/unversioned/resource_quotas_test.go index 2e5cf48f72d..0bbc487ba01 100644 --- a/pkg/client/unversioned/resource_quotas_test.go +++ b/pkg/client/unversioned/resource_quotas_test.go @@ -28,7 +28,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" ) func getResourceQuotasResoureName() string { @@ -118,7 +117,7 @@ func TestResourceQuotaList(t *testing.T) { }, Response: simple.Response{StatusCode: 200, Body: resourceQuotaList}, } - response, err := c.Setup(t).ResourceQuotas(ns).List(unversioned.ListOptions{}) + response, err := c.Setup(t).ResourceQuotas(ns).List(api.ListOptions{}) c.Validate(t, response, err) } @@ -197,6 +196,6 @@ func TestResourceQuotaWatch(t *testing.T) { Query: url.Values{"resourceVersion": []string{}}}, Response: simple.Response{StatusCode: 200}, } - _, err := c.Setup(t).ResourceQuotas(api.NamespaceAll).Watch(unversioned.ListOptions{}) + _, err := c.Setup(t).ResourceQuotas(api.NamespaceAll).Watch(api.ListOptions{}) c.Validate(t, nil, err) } diff --git a/pkg/client/unversioned/secrets.go b/pkg/client/unversioned/secrets.go index a20b0fb3bc7..3f675a68b29 100644 --- a/pkg/client/unversioned/secrets.go +++ b/pkg/client/unversioned/secrets.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -30,9 +29,9 @@ type SecretsInterface interface { Create(secret *api.Secret) (*api.Secret, error) Update(secret *api.Secret) (*api.Secret, error) Delete(name string) error - List(opts unversioned.ListOptions) (*api.SecretList, error) + List(opts api.ListOptions) (*api.SecretList, error) Get(name string) (*api.Secret, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // events implements Secrets interface @@ -62,7 +61,7 @@ func (s *secrets) Create(secret *api.Secret) (*api.Secret, error) { } // List returns a list of secrets matching the selectors. -func (s *secrets) List(opts unversioned.ListOptions) (*api.SecretList, error) { +func (s *secrets) List(opts api.ListOptions) (*api.SecretList, error) { result := &api.SecretList{} err := s.client.Get(). @@ -89,7 +88,7 @@ func (s *secrets) Get(name string) (*api.Secret, error) { } // Watch starts watching for secrets matching the given selectors. -func (s *secrets) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (s *secrets) Watch(opts api.ListOptions) (watch.Interface, error) { return s.client.Get(). Prefix("watch"). Namespace(s.namespace). diff --git a/pkg/client/unversioned/service_accounts.go b/pkg/client/unversioned/service_accounts.go index 6a2ccc60075..d826dfc95d5 100644 --- a/pkg/client/unversioned/service_accounts.go +++ b/pkg/client/unversioned/service_accounts.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -30,9 +29,9 @@ type ServiceAccountsInterface interface { Create(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error) Update(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error) Delete(name string) error - List(opts unversioned.ListOptions) (*api.ServiceAccountList, error) + List(opts api.ListOptions) (*api.ServiceAccountList, error) Get(name string) (*api.ServiceAccount, error) - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // serviceAccounts implements ServiceAccounts interface @@ -62,7 +61,7 @@ func (s *serviceAccounts) Create(serviceAccount *api.ServiceAccount) (*api.Servi } // List returns a list of serviceAccounts matching the selectors. -func (s *serviceAccounts) List(opts unversioned.ListOptions) (*api.ServiceAccountList, error) { +func (s *serviceAccounts) List(opts api.ListOptions) (*api.ServiceAccountList, error) { result := &api.ServiceAccountList{} err := s.client.Get(). @@ -89,7 +88,7 @@ func (s *serviceAccounts) Get(name string) (*api.ServiceAccount, error) { } // Watch starts watching for serviceAccounts matching the given selectors. -func (s *serviceAccounts) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (s *serviceAccounts) Watch(opts api.ListOptions) (watch.Interface, error) { return s.client.Get(). Prefix("watch"). Namespace(s.namespace). diff --git a/pkg/client/unversioned/services.go b/pkg/client/unversioned/services.go index eabe9cad188..45ef56ad955 100644 --- a/pkg/client/unversioned/services.go +++ b/pkg/client/unversioned/services.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/watch" ) @@ -30,12 +29,12 @@ type ServicesNamespacer interface { // ServiceInterface has methods to work with Service resources. type ServiceInterface interface { - List(opts unversioned.ListOptions) (*api.ServiceList, error) + List(opts api.ListOptions) (*api.ServiceList, error) Get(name string) (*api.Service, error) Create(srv *api.Service) (*api.Service, error) Update(srv *api.Service) (*api.Service, error) Delete(name string) error - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) ProxyGet(scheme, name, port, path string, params map[string]string) ResponseWrapper } @@ -51,7 +50,7 @@ func newServices(c *Client, namespace string) *services { } // List takes a selector, and returns the list of services that match that selector -func (c *services) List(opts unversioned.ListOptions) (result *api.ServiceList, err error) { +func (c *services) List(opts api.ListOptions) (result *api.ServiceList, err error) { result = &api.ServiceList{} err = c.r.Get(). Namespace(c.ns). @@ -89,7 +88,7 @@ func (c *services) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested services. -func (c *services) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *services) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/services_test.go b/pkg/client/unversioned/services_test.go index ebda5158247..d6136ee2ef4 100644 --- a/pkg/client/unversioned/services_test.go +++ b/pkg/client/unversioned/services_test.go @@ -59,7 +59,7 @@ func TestListServices(t *testing.T) { }, }, } - receivedServiceList, err := c.Setup(t).Services(ns).List(unversioned.ListOptions{}) + receivedServiceList, err := c.Setup(t).Services(ns).List(api.ListOptions{}) t.Logf("received services: %v %#v", err, receivedServiceList) c.Validate(t, receivedServiceList, err) } @@ -96,7 +96,7 @@ func TestListServicesLabels(t *testing.T) { c.Setup(t) c.QueryValidator[labelSelectorQueryParamName] = simple.ValidateLabels selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} receivedServiceList, err := c.Services(ns).List(options) c.Validate(t, receivedServiceList, err) } diff --git a/pkg/client/unversioned/testclient/actions.go b/pkg/client/unversioned/testclient/actions.go index fc6951c84bc..1e5a5e47011 100644 --- a/pkg/client/unversioned/testclient/actions.go +++ b/pkg/client/unversioned/testclient/actions.go @@ -19,7 +19,7 @@ package testclient import ( "strings" - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" @@ -44,15 +44,15 @@ func NewGetAction(resource, namespace, name string) GetActionImpl { return action } -func NewRootListAction(resource string, opts unversioned.ListOptions) ListActionImpl { +func NewRootListAction(resource string, opts api.ListOptions) ListActionImpl { action := ListActionImpl{} action.Verb = "list" action.Resource = resource - labelSelector := opts.LabelSelector.Selector + labelSelector := opts.LabelSelector if labelSelector == nil { labelSelector = labels.Everything() } - fieldSelector := opts.FieldSelector.Selector + fieldSelector := opts.FieldSelector if fieldSelector == nil { fieldSelector = fields.Everything() } @@ -61,16 +61,16 @@ func NewRootListAction(resource string, opts unversioned.ListOptions) ListAction return action } -func NewListAction(resource, namespace string, opts unversioned.ListOptions) ListActionImpl { +func NewListAction(resource, namespace string, opts api.ListOptions) ListActionImpl { action := ListActionImpl{} action.Verb = "list" action.Resource = resource action.Namespace = namespace - labelSelector := opts.LabelSelector.Selector + labelSelector := opts.LabelSelector if labelSelector == nil { labelSelector = labels.Everything() } - fieldSelector := opts.FieldSelector.Selector + fieldSelector := opts.FieldSelector if fieldSelector == nil { fieldSelector = fields.Everything() } @@ -166,15 +166,15 @@ func NewDeleteAction(resource, namespace, name string) DeleteActionImpl { return action } -func NewRootDeleteCollectionAction(resource string, opts unversioned.ListOptions) DeleteCollectionActionImpl { +func NewRootDeleteCollectionAction(resource string, opts api.ListOptions) DeleteCollectionActionImpl { action := DeleteCollectionActionImpl{} action.Verb = "delete-collection" action.Resource = resource - labelSelector := opts.LabelSelector.Selector + labelSelector := opts.LabelSelector if labelSelector == nil { labelSelector = labels.Everything() } - fieldSelector := opts.FieldSelector.Selector + fieldSelector := opts.FieldSelector if fieldSelector == nil { fieldSelector = fields.Everything() } @@ -183,16 +183,16 @@ func NewRootDeleteCollectionAction(resource string, opts unversioned.ListOptions return action } -func NewDeleteCollectionAction(resource, namespace string, opts unversioned.ListOptions) DeleteCollectionActionImpl { +func NewDeleteCollectionAction(resource, namespace string, opts api.ListOptions) DeleteCollectionActionImpl { action := DeleteCollectionActionImpl{} action.Verb = "delete-collection" action.Resource = resource action.Namespace = namespace - labelSelector := opts.LabelSelector.Selector + labelSelector := opts.LabelSelector if labelSelector == nil { labelSelector = labels.Everything() } - fieldSelector := opts.FieldSelector.Selector + fieldSelector := opts.FieldSelector if fieldSelector == nil { fieldSelector = fields.Everything() } @@ -201,15 +201,15 @@ func NewDeleteCollectionAction(resource, namespace string, opts unversioned.List return action } -func NewRootWatchAction(resource string, opts unversioned.ListOptions) WatchActionImpl { +func NewRootWatchAction(resource string, opts api.ListOptions) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource - labelSelector := opts.LabelSelector.Selector + labelSelector := opts.LabelSelector if labelSelector == nil { labelSelector = labels.Everything() } - fieldSelector := opts.FieldSelector.Selector + fieldSelector := opts.FieldSelector if fieldSelector == nil { fieldSelector = fields.Everything() } @@ -218,16 +218,16 @@ func NewRootWatchAction(resource string, opts unversioned.ListOptions) WatchActi return action } -func NewWatchAction(resource, namespace string, opts unversioned.ListOptions) WatchActionImpl { +func NewWatchAction(resource, namespace string, opts api.ListOptions) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource action.Namespace = namespace - labelSelector := opts.LabelSelector.Selector + labelSelector := opts.LabelSelector if labelSelector == nil { labelSelector = labels.Everything() } - fieldSelector := opts.FieldSelector.Selector + fieldSelector := opts.FieldSelector if fieldSelector == nil { fieldSelector = fields.Everything() } diff --git a/pkg/client/unversioned/testclient/fake_componentstatuses.go b/pkg/client/unversioned/testclient/fake_componentstatuses.go index 535f29d64f0..34bf210d473 100644 --- a/pkg/client/unversioned/testclient/fake_componentstatuses.go +++ b/pkg/client/unversioned/testclient/fake_componentstatuses.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" ) // Fake implements ComponentStatusInterface. @@ -35,7 +34,7 @@ func (c *FakeComponentStatuses) Get(name string) (*api.ComponentStatus, error) { return obj.(*api.ComponentStatus), err } -func (c *FakeComponentStatuses) List(opts unversioned.ListOptions) (result *api.ComponentStatusList, err error) { +func (c *FakeComponentStatuses) List(opts api.ListOptions) (result *api.ComponentStatusList, err error) { obj, err := c.Fake.Invokes(NewRootListAction("componentstatuses", opts), &api.ComponentStatusList{}) if obj == nil { return nil, err diff --git a/pkg/client/unversioned/testclient/fake_daemon_sets.go b/pkg/client/unversioned/testclient/fake_daemon_sets.go index 27483827213..d0e1e73e149 100644 --- a/pkg/client/unversioned/testclient/fake_daemon_sets.go +++ b/pkg/client/unversioned/testclient/fake_daemon_sets.go @@ -17,7 +17,7 @@ limitations under the License. package testclient import ( - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/apis/extensions" kclientlib "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/watch" @@ -41,7 +41,7 @@ func (c *FakeDaemonSets) Get(name string) (*extensions.DaemonSet, error) { return obj.(*extensions.DaemonSet), err } -func (c *FakeDaemonSets) List(opts unversioned.ListOptions) (*extensions.DaemonSetList, error) { +func (c *FakeDaemonSets) List(opts api.ListOptions) (*extensions.DaemonSetList, error) { obj, err := c.Fake.Invokes(NewListAction("daemonsets", c.Namespace, opts), &extensions.DaemonSetList{}) if obj == nil { return nil, err @@ -78,6 +78,6 @@ func (c *FakeDaemonSets) Delete(name string) error { return err } -func (c *FakeDaemonSets) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeDaemonSets) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("daemonsets", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_deployments.go b/pkg/client/unversioned/testclient/fake_deployments.go index 3b4a2ecd5e3..6df56782c36 100644 --- a/pkg/client/unversioned/testclient/fake_deployments.go +++ b/pkg/client/unversioned/testclient/fake_deployments.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/watch" @@ -40,12 +39,12 @@ func (c *FakeDeployments) Get(name string) (*extensions.Deployment, error) { return obj.(*extensions.Deployment), err } -func (c *FakeDeployments) List(opts unversioned.ListOptions) (*extensions.DeploymentList, error) { +func (c *FakeDeployments) List(opts api.ListOptions) (*extensions.DeploymentList, error) { obj, err := c.Fake.Invokes(NewListAction("deployments", c.Namespace, opts), &extensions.DeploymentList{}) if obj == nil { return nil, err } - label := opts.LabelSelector.Selector + label := opts.LabelSelector if label == nil { label = labels.Everything() } @@ -90,6 +89,6 @@ func (c *FakeDeployments) Delete(name string, options *api.DeleteOptions) error return err } -func (c *FakeDeployments) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeDeployments) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("deployments", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_endpoints.go b/pkg/client/unversioned/testclient/fake_endpoints.go index c88effc3a8e..68f6178f778 100644 --- a/pkg/client/unversioned/testclient/fake_endpoints.go +++ b/pkg/client/unversioned/testclient/fake_endpoints.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -38,7 +37,7 @@ func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error) { return obj.(*api.Endpoints), err } -func (c *FakeEndpoints) List(opts unversioned.ListOptions) (*api.EndpointsList, error) { +func (c *FakeEndpoints) List(opts api.ListOptions) (*api.EndpointsList, error) { obj, err := c.Fake.Invokes(NewListAction("endpoints", c.Namespace, opts), &api.EndpointsList{}) if obj == nil { return nil, err @@ -70,6 +69,6 @@ func (c *FakeEndpoints) Delete(name string) error { return err } -func (c *FakeEndpoints) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeEndpoints) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("endpoints", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_events.go b/pkg/client/unversioned/testclient/fake_events.go index be4406e9f97..3da2143fc41 100644 --- a/pkg/client/unversioned/testclient/fake_events.go +++ b/pkg/client/unversioned/testclient/fake_events.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/watch" @@ -46,7 +45,7 @@ func (c *FakeEvents) Get(name string) (*api.Event, error) { } // List returns a list of events matching the selectors. -func (c *FakeEvents) List(opts unversioned.ListOptions) (*api.EventList, error) { +func (c *FakeEvents) List(opts api.ListOptions) (*api.EventList, error) { action := NewRootListAction("events", opts) if c.Namespace != "" { action = NewListAction("events", c.Namespace, opts) @@ -110,7 +109,7 @@ func (c *FakeEvents) Delete(name string) error { return err } -func (c *FakeEvents) DeleteCollection(options *api.DeleteOptions, listOptions unversioned.ListOptions) error { +func (c *FakeEvents) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { action := NewRootDeleteCollectionAction("events", listOptions) if c.Namespace != "" { action = NewDeleteCollectionAction("events", c.Namespace, listOptions) @@ -120,7 +119,7 @@ func (c *FakeEvents) DeleteCollection(options *api.DeleteOptions, listOptions un } // Watch starts watching for events matching the given selectors. -func (c *FakeEvents) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeEvents) Watch(opts api.ListOptions) (watch.Interface, error) { action := NewRootWatchAction("events", opts) if c.Namespace != "" { action = NewWatchAction("events", c.Namespace, opts) @@ -130,9 +129,9 @@ func (c *FakeEvents) Watch(opts unversioned.ListOptions) (watch.Interface, error // Search returns a list of events matching the specified object. func (c *FakeEvents) Search(objOrRef runtime.Object) (*api.EventList, error) { - action := NewRootListAction("events", unversioned.ListOptions{}) + action := NewRootListAction("events", api.ListOptions{}) if c.Namespace != "" { - action = NewListAction("events", c.Namespace, unversioned.ListOptions{}) + action = NewListAction("events", c.Namespace, api.ListOptions{}) } obj, err := c.Fake.Invokes(action, &api.EventList{}) if obj == nil { diff --git a/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go b/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go index 28e1c3c3a18..a70a1af99db 100644 --- a/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go +++ b/pkg/client/unversioned/testclient/fake_horizontal_pod_autoscalers.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/watch" @@ -40,12 +39,12 @@ func (c *FakeHorizontalPodAutoscalers) Get(name string) (*extensions.HorizontalP return obj.(*extensions.HorizontalPodAutoscaler), err } -func (c *FakeHorizontalPodAutoscalers) List(opts unversioned.ListOptions) (*extensions.HorizontalPodAutoscalerList, error) { +func (c *FakeHorizontalPodAutoscalers) List(opts api.ListOptions) (*extensions.HorizontalPodAutoscalerList, error) { obj, err := c.Fake.Invokes(NewListAction("horizontalpodautoscalers", c.Namespace, opts), &extensions.HorizontalPodAutoscalerList{}) if obj == nil { return nil, err } - label := opts.LabelSelector.Selector + label := opts.LabelSelector if label == nil { label = labels.Everything() } @@ -89,6 +88,6 @@ func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOp return err } -func (c *FakeHorizontalPodAutoscalers) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeHorizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("horizontalpodautoscalers", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_ingress.go b/pkg/client/unversioned/testclient/fake_ingress.go index f05584513de..b15458997f1 100644 --- a/pkg/client/unversioned/testclient/fake_ingress.go +++ b/pkg/client/unversioned/testclient/fake_ingress.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/watch" ) @@ -39,7 +38,7 @@ func (c *FakeIngress) Get(name string) (*extensions.Ingress, error) { return obj.(*extensions.Ingress), err } -func (c *FakeIngress) List(opts unversioned.ListOptions) (*extensions.IngressList, error) { +func (c *FakeIngress) List(opts api.ListOptions) (*extensions.IngressList, error) { obj, err := c.Fake.Invokes(NewListAction("ingresses", c.Namespace, opts), &extensions.IngressList{}) if obj == nil { return nil, err @@ -71,7 +70,7 @@ func (c *FakeIngress) Delete(name string, options *api.DeleteOptions) error { return err } -func (c *FakeIngress) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeIngress) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("ingresses", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_jobs.go b/pkg/client/unversioned/testclient/fake_jobs.go index dbacfd4fb8c..d6fb79fa1c2 100644 --- a/pkg/client/unversioned/testclient/fake_jobs.go +++ b/pkg/client/unversioned/testclient/fake_jobs.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/watch" ) @@ -39,7 +38,7 @@ func (c *FakeJobs) Get(name string) (*extensions.Job, error) { return obj.(*extensions.Job), err } -func (c *FakeJobs) List(opts unversioned.ListOptions) (*extensions.JobList, error) { +func (c *FakeJobs) List(opts api.ListOptions) (*extensions.JobList, error) { obj, err := c.Fake.Invokes(NewListAction("jobs", c.Namespace, opts), &extensions.JobList{}) if obj == nil { return nil, err @@ -71,7 +70,7 @@ func (c *FakeJobs) Delete(name string, options *api.DeleteOptions) error { return err } -func (c *FakeJobs) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeJobs) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("jobs", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_limit_ranges.go b/pkg/client/unversioned/testclient/fake_limit_ranges.go index 32179700a84..3669f5ff823 100644 --- a/pkg/client/unversioned/testclient/fake_limit_ranges.go +++ b/pkg/client/unversioned/testclient/fake_limit_ranges.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -38,7 +37,7 @@ func (c *FakeLimitRanges) Get(name string) (*api.LimitRange, error) { return obj.(*api.LimitRange), err } -func (c *FakeLimitRanges) List(opts unversioned.ListOptions) (*api.LimitRangeList, error) { +func (c *FakeLimitRanges) List(opts api.ListOptions) (*api.LimitRangeList, error) { obj, err := c.Fake.Invokes(NewListAction("limitranges", c.Namespace, opts), &api.LimitRangeList{}) if obj == nil { return nil, err @@ -70,6 +69,6 @@ func (c *FakeLimitRanges) Delete(name string) error { return err } -func (c *FakeLimitRanges) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeLimitRanges) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("limitranges", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_namespaces.go b/pkg/client/unversioned/testclient/fake_namespaces.go index 27edc4e3bba..8c4ac1ac273 100644 --- a/pkg/client/unversioned/testclient/fake_namespaces.go +++ b/pkg/client/unversioned/testclient/fake_namespaces.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -37,7 +36,7 @@ func (c *FakeNamespaces) Get(name string) (*api.Namespace, error) { return obj.(*api.Namespace), err } -func (c *FakeNamespaces) List(opts unversioned.ListOptions) (*api.NamespaceList, error) { +func (c *FakeNamespaces) List(opts api.ListOptions) (*api.NamespaceList, error) { obj, err := c.Fake.Invokes(NewRootListAction("namespaces", opts), &api.NamespaceList{}) if obj == nil { return nil, err @@ -69,7 +68,7 @@ func (c *FakeNamespaces) Delete(name string) error { return err } -func (c *FakeNamespaces) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeNamespaces) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewRootWatchAction("namespaces", opts)) } diff --git a/pkg/client/unversioned/testclient/fake_nodes.go b/pkg/client/unversioned/testclient/fake_nodes.go index 7d59e7fa5b5..b1943366e58 100644 --- a/pkg/client/unversioned/testclient/fake_nodes.go +++ b/pkg/client/unversioned/testclient/fake_nodes.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -37,7 +36,7 @@ func (c *FakeNodes) Get(name string) (*api.Node, error) { return obj.(*api.Node), err } -func (c *FakeNodes) List(opts unversioned.ListOptions) (*api.NodeList, error) { +func (c *FakeNodes) List(opts api.ListOptions) (*api.NodeList, error) { obj, err := c.Fake.Invokes(NewRootListAction("nodes", opts), &api.NodeList{}) if obj == nil { return nil, err @@ -69,7 +68,7 @@ func (c *FakeNodes) Delete(name string) error { return err } -func (c *FakeNodes) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeNodes) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewRootWatchAction("nodes", opts)) } diff --git a/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go b/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go index d37af71932a..cadfb084c33 100644 --- a/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go +++ b/pkg/client/unversioned/testclient/fake_persistent_volume_claims.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -36,7 +35,7 @@ func (c *FakePersistentVolumeClaims) Get(name string) (*api.PersistentVolumeClai return obj.(*api.PersistentVolumeClaim), err } -func (c *FakePersistentVolumeClaims) List(opts unversioned.ListOptions) (*api.PersistentVolumeClaimList, error) { +func (c *FakePersistentVolumeClaims) List(opts api.ListOptions) (*api.PersistentVolumeClaimList, error) { obj, err := c.Fake.Invokes(NewListAction("persistentvolumeclaims", c.Namespace, opts), &api.PersistentVolumeClaimList{}) if obj == nil { return nil, err @@ -68,7 +67,7 @@ func (c *FakePersistentVolumeClaims) Delete(name string) error { return err } -func (c *FakePersistentVolumeClaims) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakePersistentVolumeClaims) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("persistentvolumeclaims", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_persistent_volumes.go b/pkg/client/unversioned/testclient/fake_persistent_volumes.go index 65993f9109a..cb184bc4416 100644 --- a/pkg/client/unversioned/testclient/fake_persistent_volumes.go +++ b/pkg/client/unversioned/testclient/fake_persistent_volumes.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -35,7 +34,7 @@ func (c *FakePersistentVolumes) Get(name string) (*api.PersistentVolume, error) return obj.(*api.PersistentVolume), err } -func (c *FakePersistentVolumes) List(opts unversioned.ListOptions) (*api.PersistentVolumeList, error) { +func (c *FakePersistentVolumes) List(opts api.ListOptions) (*api.PersistentVolumeList, error) { obj, err := c.Fake.Invokes(NewRootListAction("persistentvolumes", opts), &api.PersistentVolumeList{}) if obj == nil { return nil, err @@ -67,7 +66,7 @@ func (c *FakePersistentVolumes) Delete(name string) error { return err } -func (c *FakePersistentVolumes) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakePersistentVolumes) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewRootWatchAction("persistentvolumes", opts)) } diff --git a/pkg/client/unversioned/testclient/fake_pod_templates.go b/pkg/client/unversioned/testclient/fake_pod_templates.go index ef13aa63ad0..47ff3d8ace2 100644 --- a/pkg/client/unversioned/testclient/fake_pod_templates.go +++ b/pkg/client/unversioned/testclient/fake_pod_templates.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -38,7 +37,7 @@ func (c *FakePodTemplates) Get(name string) (*api.PodTemplate, error) { return obj.(*api.PodTemplate), err } -func (c *FakePodTemplates) List(opts unversioned.ListOptions) (*api.PodTemplateList, error) { +func (c *FakePodTemplates) List(opts api.ListOptions) (*api.PodTemplateList, error) { obj, err := c.Fake.Invokes(NewListAction("podtemplates", c.Namespace, opts), &api.PodTemplateList{}) if obj == nil { return nil, err @@ -70,6 +69,6 @@ func (c *FakePodTemplates) Delete(name string, options *api.DeleteOptions) error return err } -func (c *FakePodTemplates) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakePodTemplates) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("podtemplates", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_pods.go b/pkg/client/unversioned/testclient/fake_pods.go index 2827458f267..824356aacd4 100644 --- a/pkg/client/unversioned/testclient/fake_pods.go +++ b/pkg/client/unversioned/testclient/fake_pods.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/watch" @@ -40,12 +39,12 @@ func (c *FakePods) Get(name string) (*api.Pod, error) { return obj.(*api.Pod), err } -func (c *FakePods) List(opts unversioned.ListOptions) (*api.PodList, error) { +func (c *FakePods) List(opts api.ListOptions) (*api.PodList, error) { obj, err := c.Fake.Invokes(NewListAction("pods", c.Namespace, opts), &api.PodList{}) if obj == nil { return nil, err } - label := opts.LabelSelector.Selector + label := opts.LabelSelector if label == nil { label = labels.Everything() } @@ -81,7 +80,7 @@ func (c *FakePods) Delete(name string, options *api.DeleteOptions) error { return err } -func (c *FakePods) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakePods) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("pods", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_replication_controllers.go b/pkg/client/unversioned/testclient/fake_replication_controllers.go index c87a5f70cdc..e44b8261558 100644 --- a/pkg/client/unversioned/testclient/fake_replication_controllers.go +++ b/pkg/client/unversioned/testclient/fake_replication_controllers.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -38,7 +37,7 @@ func (c *FakeReplicationControllers) Get(name string) (*api.ReplicationControlle return obj.(*api.ReplicationController), err } -func (c *FakeReplicationControllers) List(opts unversioned.ListOptions) (*api.ReplicationControllerList, error) { +func (c *FakeReplicationControllers) List(opts api.ListOptions) (*api.ReplicationControllerList, error) { obj, err := c.Fake.Invokes(NewListAction("replicationcontrollers", c.Namespace, opts), &api.ReplicationControllerList{}) if obj == nil { return nil, err @@ -78,6 +77,6 @@ func (c *FakeReplicationControllers) Delete(name string) error { return err } -func (c *FakeReplicationControllers) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeReplicationControllers) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("replicationcontrollers", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_resource_quotas.go b/pkg/client/unversioned/testclient/fake_resource_quotas.go index fcb75c5cf71..d5090f0d0fb 100644 --- a/pkg/client/unversioned/testclient/fake_resource_quotas.go +++ b/pkg/client/unversioned/testclient/fake_resource_quotas.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -38,7 +37,7 @@ func (c *FakeResourceQuotas) Get(name string) (*api.ResourceQuota, error) { return obj.(*api.ResourceQuota), err } -func (c *FakeResourceQuotas) List(opts unversioned.ListOptions) (*api.ResourceQuotaList, error) { +func (c *FakeResourceQuotas) List(opts api.ListOptions) (*api.ResourceQuotaList, error) { obj, err := c.Fake.Invokes(NewListAction("resourcequotas", c.Namespace, opts), &api.ResourceQuotaList{}) if obj == nil { return nil, err @@ -70,7 +69,7 @@ func (c *FakeResourceQuotas) Delete(name string) error { return err } -func (c *FakeResourceQuotas) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeResourceQuotas) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("resourcequotas", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_secrets.go b/pkg/client/unversioned/testclient/fake_secrets.go index b4349fd6c8e..f54cffb8717 100644 --- a/pkg/client/unversioned/testclient/fake_secrets.go +++ b/pkg/client/unversioned/testclient/fake_secrets.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -38,7 +37,7 @@ func (c *FakeSecrets) Get(name string) (*api.Secret, error) { return obj.(*api.Secret), err } -func (c *FakeSecrets) List(opts unversioned.ListOptions) (*api.SecretList, error) { +func (c *FakeSecrets) List(opts api.ListOptions) (*api.SecretList, error) { obj, err := c.Fake.Invokes(NewListAction("secrets", c.Namespace, opts), &api.SecretList{}) if obj == nil { return nil, err @@ -70,6 +69,6 @@ func (c *FakeSecrets) Delete(name string) error { return err } -func (c *FakeSecrets) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeSecrets) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("secrets", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_service_accounts.go b/pkg/client/unversioned/testclient/fake_service_accounts.go index 7e1aa32851f..e40641668e1 100644 --- a/pkg/client/unversioned/testclient/fake_service_accounts.go +++ b/pkg/client/unversioned/testclient/fake_service_accounts.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -38,7 +37,7 @@ func (c *FakeServiceAccounts) Get(name string) (*api.ServiceAccount, error) { return obj.(*api.ServiceAccount), err } -func (c *FakeServiceAccounts) List(opts unversioned.ListOptions) (*api.ServiceAccountList, error) { +func (c *FakeServiceAccounts) List(opts api.ListOptions) (*api.ServiceAccountList, error) { obj, err := c.Fake.Invokes(NewListAction("serviceaccounts", c.Namespace, opts), &api.ServiceAccountList{}) if obj == nil { return nil, err @@ -70,6 +69,6 @@ func (c *FakeServiceAccounts) Delete(name string) error { return err } -func (c *FakeServiceAccounts) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeServiceAccounts) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("serviceaccounts", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_services.go b/pkg/client/unversioned/testclient/fake_services.go index 5604f767756..8c1a7de4a75 100644 --- a/pkg/client/unversioned/testclient/fake_services.go +++ b/pkg/client/unversioned/testclient/fake_services.go @@ -18,7 +18,6 @@ package testclient import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -39,7 +38,7 @@ func (c *FakeServices) Get(name string) (*api.Service, error) { return obj.(*api.Service), err } -func (c *FakeServices) List(opts unversioned.ListOptions) (*api.ServiceList, error) { +func (c *FakeServices) List(opts api.ListOptions) (*api.ServiceList, error) { obj, err := c.Fake.Invokes(NewListAction("services", c.Namespace, opts), &api.ServiceList{}) if obj == nil { return nil, err @@ -71,7 +70,7 @@ func (c *FakeServices) Delete(name string) error { return err } -func (c *FakeServices) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeServices) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("services", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/fake_thirdpartyresources.go b/pkg/client/unversioned/testclient/fake_thirdpartyresources.go index 516724ff0ef..8aa198d70e7 100644 --- a/pkg/client/unversioned/testclient/fake_thirdpartyresources.go +++ b/pkg/client/unversioned/testclient/fake_thirdpartyresources.go @@ -17,7 +17,7 @@ limitations under the License. package testclient import ( - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/apis/extensions" kclientlib "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/watch" @@ -41,7 +41,7 @@ func (c *FakeThirdPartyResources) Get(name string) (*extensions.ThirdPartyResour return obj.(*extensions.ThirdPartyResource), err } -func (c *FakeThirdPartyResources) List(opts unversioned.ListOptions) (*extensions.ThirdPartyResourceList, error) { +func (c *FakeThirdPartyResources) List(opts api.ListOptions) (*extensions.ThirdPartyResourceList, error) { obj, err := c.Fake.Invokes(NewListAction("thirdpartyresources", c.Namespace, opts), &extensions.ThirdPartyResourceList{}) if obj == nil { return nil, err @@ -78,6 +78,6 @@ func (c *FakeThirdPartyResources) Delete(name string) error { return err } -func (c *FakeThirdPartyResources) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *FakeThirdPartyResources) Watch(opts api.ListOptions) (watch.Interface, error) { return c.Fake.InvokesWatch(NewWatchAction("thirdpartyresources", c.Namespace, opts)) } diff --git a/pkg/client/unversioned/testclient/testclient_test.go b/pkg/client/unversioned/testclient/testclient_test.go index 7aabc6cdfb7..cacf76b7dc0 100644 --- a/pkg/client/unversioned/testclient/testclient_test.go +++ b/pkg/client/unversioned/testclient/testclient_test.go @@ -22,7 +22,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/runtime" ) @@ -33,7 +32,7 @@ func TestNewClient(t *testing.T) { } client := &Fake{} client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper())) - list, err := client.Services("test").List(unversioned.ListOptions{}) + list, err := client.Services("test").List(api.ListOptions{}) if err != nil { t.Fatal(err) } @@ -42,7 +41,7 @@ func TestNewClient(t *testing.T) { } // When list is invoked a second time, the same results are returned. - list, err = client.Services("test").List(unversioned.ListOptions{}) + list, err = client.Services("test").List(api.ListOptions{}) if err != nil { t.Fatal(err) } @@ -64,12 +63,12 @@ func TestErrors(t *testing.T) { }) client := &Fake{} client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper())) - _, err := client.Services("test").List(unversioned.ListOptions{}) + _, err := client.Services("test").List(api.ListOptions{}) if !errors.IsNotFound(err) { t.Fatalf("unexpected error: %v", err) } t.Logf("error: %#v", err.(*errors.StatusError).Status()) - _, err = client.Services("test").List(unversioned.ListOptions{}) + _, err = client.Services("test").List(api.ListOptions{}) if !errors.IsForbidden(err) { t.Fatalf("unexpected error: %v", err) } diff --git a/pkg/client/unversioned/thirdpartyresources.go b/pkg/client/unversioned/thirdpartyresources.go index b7fbf8dcfed..fedd9fb78e0 100644 --- a/pkg/client/unversioned/thirdpartyresources.go +++ b/pkg/client/unversioned/thirdpartyresources.go @@ -18,7 +18,6 @@ package unversioned import ( "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/watch" ) @@ -29,13 +28,13 @@ type ThirdPartyResourceNamespacer interface { } type ThirdPartyResourceInterface interface { - List(opts unversioned.ListOptions) (*extensions.ThirdPartyResourceList, error) + List(opts api.ListOptions) (*extensions.ThirdPartyResourceList, error) Get(name string) (*extensions.ThirdPartyResource, error) Create(ctrl *extensions.ThirdPartyResource) (*extensions.ThirdPartyResource, error) Update(ctrl *extensions.ThirdPartyResource) (*extensions.ThirdPartyResource, error) UpdateStatus(ctrl *extensions.ThirdPartyResource) (*extensions.ThirdPartyResource, error) Delete(name string) error - Watch(opts unversioned.ListOptions) (watch.Interface, error) + Watch(opts api.ListOptions) (watch.Interface, error) } // thirdPartyResources implements DaemonsSetsNamespacer interface @@ -51,7 +50,7 @@ func newThirdPartyResources(c *ExtensionsClient, namespace string) *thirdPartyRe // Ensure statically that thirdPartyResources implements ThirdPartyResourcesInterface. var _ ThirdPartyResourceInterface = &thirdPartyResources{} -func (c *thirdPartyResources) List(opts unversioned.ListOptions) (result *extensions.ThirdPartyResourceList, err error) { +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) return @@ -91,7 +90,7 @@ func (c *thirdPartyResources) Delete(name string) error { } // Watch returns a watch.Interface that watches the requested daemon sets. -func (c *thirdPartyResources) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (c *thirdPartyResources) Watch(opts api.ListOptions) (watch.Interface, error) { return c.r.Get(). Prefix("watch"). Namespace(c.ns). diff --git a/pkg/client/unversioned/thirdpartyresources_test.go b/pkg/client/unversioned/thirdpartyresources_test.go index cccd58a8448..50c4c24a8d1 100644 --- a/pkg/client/unversioned/thirdpartyresources_test.go +++ b/pkg/client/unversioned/thirdpartyresources_test.go @@ -16,18 +16,14 @@ limitations under the License. package unversioned_test -import ( - . "k8s.io/kubernetes/pkg/client/unversioned" - "k8s.io/kubernetes/pkg/client/unversioned/testclient/simple" -) - import ( "testing" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" + . "k8s.io/kubernetes/pkg/client/unversioned" + "k8s.io/kubernetes/pkg/client/unversioned/testclient/simple" ) func getThirdPartyResourceName() string { @@ -58,7 +54,7 @@ func TestListThirdPartyResources(t *testing.T) { }, }, } - receivedDSs, err := c.Setup(t).Extensions().ThirdPartyResources(ns).List(unversioned.ListOptions{}) + receivedDSs, err := c.Setup(t).Extensions().ThirdPartyResources(ns).List(api.ListOptions{}) c.Validate(t, receivedDSs, err) } diff --git a/pkg/controller/daemon/controller.go b/pkg/controller/daemon/controller.go index 0e82adad5f2..96dab49cabc 100644 --- a/pkg/controller/daemon/controller.go +++ b/pkg/controller/daemon/controller.go @@ -23,7 +23,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/client/record" @@ -96,10 +95,10 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle // Manage addition/update of daemon sets. dsc.dsStore.Store, dsc.dsController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).Watch(options) }, }, @@ -128,10 +127,10 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle // more pods until all the effects (expectations) of a daemon set's create/delete have been observed. dsc.podStore.Store, dsc.podController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return dsc.kubeClient.Pods(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return dsc.kubeClient.Pods(api.NamespaceAll).Watch(options) }, }, @@ -146,10 +145,10 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle // Watch for new nodes or updates to nodes - daemon pods are launched on new nodes, and possibly when labels on nodes change, dsc.nodeStore.Store, dsc.nodeController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return dsc.kubeClient.Nodes().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return dsc.kubeClient.Nodes().Watch(options) }, }, diff --git a/pkg/controller/deployment/deployment_controller.go b/pkg/controller/deployment/deployment_controller.go index 6a99afcb74d..854e2637c1e 100644 --- a/pkg/controller/deployment/deployment_controller.go +++ b/pkg/controller/deployment/deployment_controller.go @@ -23,7 +23,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" @@ -59,7 +58,7 @@ func (d *DeploymentController) Run(syncPeriod time.Duration) { } func (d *DeploymentController) reconcileDeployments() []error { - list, err := d.expClient.Deployments(api.NamespaceAll).List(unversioned.ListOptions{}) + list, err := d.expClient.Deployments(api.NamespaceAll).List(api.ListOptions{}) if err != nil { return []error{fmt.Errorf("error listing deployments: %v", err)} } diff --git a/pkg/controller/endpoint/endpoints_controller.go b/pkg/controller/endpoint/endpoints_controller.go index 141d071531b..41654ce2c69 100644 --- a/pkg/controller/endpoint/endpoints_controller.go +++ b/pkg/controller/endpoint/endpoints_controller.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/endpoints" "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller" @@ -62,10 +61,10 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync e.serviceStore.Store, e.serviceController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return e.client.Services(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return e.client.Services(api.NamespaceAll).Watch(options) }, }, @@ -83,10 +82,10 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync e.podStore.Store, e.podController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return e.client.Pods(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return e.client.Pods(api.NamespaceAll).Watch(options) }, }, @@ -385,7 +384,7 @@ func (e *EndpointController) syncService(key string) { // some stragglers could have been left behind if the endpoint controller // reboots). func (e *EndpointController) checkLeftoverEndpoints() { - list, err := e.client.Endpoints(api.NamespaceAll).List(unversioned.ListOptions{}) + list, err := e.client.Endpoints(api.NamespaceAll).List(api.ListOptions{}) if err != nil { glog.Errorf("Unable to list endpoints (%v); orphaned endpoints will not be cleaned up. (They're pretty harmless, but you can restart this component if you want another attempt made.)", err) return diff --git a/pkg/controller/framework/fake_controller_source.go b/pkg/controller/framework/fake_controller_source.go index 23e530b0309..fa28171137c 100644 --- a/pkg/controller/framework/fake_controller_source.go +++ b/pkg/controller/framework/fake_controller_source.go @@ -24,7 +24,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/meta" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/watch" @@ -122,7 +121,7 @@ func (f *FakeControllerSource) Change(e watch.Event, watchProbability float64) { } // List returns a list object, with its resource version set. -func (f *FakeControllerSource) List(options unversioned.ListOptions) (runtime.Object, error) { +func (f *FakeControllerSource) List(options api.ListOptions) (runtime.Object, error) { f.lock.RLock() defer f.lock.RUnlock() list := make([]runtime.Object, 0, len(f.items)) @@ -152,7 +151,7 @@ func (f *FakeControllerSource) List(options unversioned.ListOptions) (runtime.Ob // Watch returns a watch, which will be pre-populated with all changes // after resourceVersion. -func (f *FakeControllerSource) Watch(options unversioned.ListOptions) (watch.Interface, error) { +func (f *FakeControllerSource) Watch(options api.ListOptions) (watch.Interface, error) { f.lock.RLock() defer f.lock.RUnlock() rc, err := strconv.Atoi(options.ResourceVersion) diff --git a/pkg/controller/framework/fake_controller_source_test.go b/pkg/controller/framework/fake_controller_source_test.go index 8e01628bd22..01269ce6435 100644 --- a/pkg/controller/framework/fake_controller_source_test.go +++ b/pkg/controller/framework/fake_controller_source_test.go @@ -21,7 +21,6 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/watch" ) @@ -65,13 +64,13 @@ func TestRCNumber(t *testing.T) { source.Modify(pod("foo")) source.Modify(pod("foo")) - w, err := source.Watch(unversioned.ListOptions{ResourceVersion: "1"}) + w, err := source.Watch(api.ListOptions{ResourceVersion: "1"}) if err != nil { t.Fatalf("Unexpected error: %v", err) } go consume(t, w, []string{"2", "3"}, wg) - list, err := source.List(unversioned.ListOptions{}) + list, err := source.List(api.ListOptions{}) if err != nil { t.Fatalf("Unexpected error: %v", err) } @@ -79,13 +78,13 @@ func TestRCNumber(t *testing.T) { t.Errorf("wanted %v, got %v", e, a) } - w2, err := source.Watch(unversioned.ListOptions{ResourceVersion: "2"}) + w2, err := source.Watch(api.ListOptions{ResourceVersion: "2"}) if err != nil { t.Fatalf("Unexpected error: %v", err) } go consume(t, w2, []string{"3"}, wg) - w3, err := source.Watch(unversioned.ListOptions{ResourceVersion: "3"}) + w3, err := source.Watch(api.ListOptions{ResourceVersion: "3"}) if err != nil { t.Fatalf("Unexpected error: %v", err) } diff --git a/pkg/controller/gc/gc_controller.go b/pkg/controller/gc/gc_controller.go index 8e1bfe63c86..a883078c7c3 100644 --- a/pkg/controller/gc/gc_controller.go +++ b/pkg/controller/gc/gc_controller.go @@ -22,7 +22,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" @@ -66,12 +65,12 @@ func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc, gcc.podStore.Store, gcc.podStoreSyncer = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - options.FieldSelector.Selector = terminatedSelector + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.FieldSelector = terminatedSelector return gcc.kubeClient.Pods(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.FieldSelector.Selector = terminatedSelector + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.FieldSelector = terminatedSelector return gcc.kubeClient.Pods(api.NamespaceAll).Watch(options) }, }, diff --git a/pkg/controller/job/controller.go b/pkg/controller/job/controller.go index 5ec006061de..eea1860a595 100644 --- a/pkg/controller/job/controller.go +++ b/pkg/controller/job/controller.go @@ -83,10 +83,10 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn jm.jobStore.Store, jm.jobController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).Watch(options) }, }, @@ -106,10 +106,10 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn jm.podStore.Store, jm.podController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return jm.kubeClient.Pods(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return jm.kubeClient.Pods(api.NamespaceAll).Watch(options) }, }, diff --git a/pkg/controller/namespace/namespace_controller.go b/pkg/controller/namespace/namespace_controller.go index 23553c6bafa..0176f7bdeba 100644 --- a/pkg/controller/namespace/namespace_controller.go +++ b/pkg/controller/namespace/namespace_controller.go @@ -45,10 +45,10 @@ func NewNamespaceController(kubeClient client.Interface, versions *unversioned.A var controller *framework.Controller _, controller = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return kubeClient.Namespaces().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return kubeClient.Namespaces().Watch(options) }, }, @@ -337,7 +337,7 @@ func syncNamespace(kubeClient client.Interface, versions *unversioned.APIVersion } func deleteLimitRanges(kubeClient client.Interface, ns string) error { - items, err := kubeClient.LimitRanges(ns).List(unversioned.ListOptions{}) + items, err := kubeClient.LimitRanges(ns).List(api.ListOptions{}) if err != nil { return err } @@ -351,7 +351,7 @@ func deleteLimitRanges(kubeClient client.Interface, ns string) error { } func deleteResourceQuotas(kubeClient client.Interface, ns string) error { - resourceQuotas, err := kubeClient.ResourceQuotas(ns).List(unversioned.ListOptions{}) + resourceQuotas, err := kubeClient.ResourceQuotas(ns).List(api.ListOptions{}) if err != nil { return err } @@ -365,7 +365,7 @@ func deleteResourceQuotas(kubeClient client.Interface, ns string) error { } func deleteServiceAccounts(kubeClient client.Interface, ns string) error { - items, err := kubeClient.ServiceAccounts(ns).List(unversioned.ListOptions{}) + items, err := kubeClient.ServiceAccounts(ns).List(api.ListOptions{}) if err != nil { return err } @@ -379,7 +379,7 @@ func deleteServiceAccounts(kubeClient client.Interface, ns string) error { } func deleteServices(kubeClient client.Interface, ns string) error { - items, err := kubeClient.Services(ns).List(unversioned.ListOptions{}) + items, err := kubeClient.Services(ns).List(api.ListOptions{}) if err != nil { return err } @@ -393,7 +393,7 @@ func deleteServices(kubeClient client.Interface, ns string) error { } func deleteReplicationControllers(kubeClient client.Interface, ns string) error { - items, err := kubeClient.ReplicationControllers(ns).List(unversioned.ListOptions{}) + items, err := kubeClient.ReplicationControllers(ns).List(api.ListOptions{}) if err != nil { return err } @@ -407,7 +407,7 @@ func deleteReplicationControllers(kubeClient client.Interface, ns string) error } func deletePods(kubeClient client.Interface, ns string, before unversioned.Time) (int64, error) { - items, err := kubeClient.Pods(ns).List(unversioned.ListOptions{}) + items, err := kubeClient.Pods(ns).List(api.ListOptions{}) if err != nil { return 0, err } @@ -436,11 +436,11 @@ func deletePods(kubeClient client.Interface, ns string, before unversioned.Time) } func deleteEvents(kubeClient client.Interface, ns string) error { - return kubeClient.Events(ns).DeleteCollection(nil, unversioned.ListOptions{}) + return kubeClient.Events(ns).DeleteCollection(nil, api.ListOptions{}) } func deleteSecrets(kubeClient client.Interface, ns string) error { - items, err := kubeClient.Secrets(ns).List(unversioned.ListOptions{}) + items, err := kubeClient.Secrets(ns).List(api.ListOptions{}) if err != nil { return err } @@ -454,7 +454,7 @@ func deleteSecrets(kubeClient client.Interface, ns string) error { } func deletePersistentVolumeClaims(kubeClient client.Interface, ns string) error { - items, err := kubeClient.PersistentVolumeClaims(ns).List(unversioned.ListOptions{}) + items, err := kubeClient.PersistentVolumeClaims(ns).List(api.ListOptions{}) if err != nil { return err } @@ -468,7 +468,7 @@ func deletePersistentVolumeClaims(kubeClient client.Interface, ns string) error } func deleteHorizontalPodAutoscalers(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.HorizontalPodAutoscalers(ns).List(unversioned.ListOptions{}) + items, err := expClient.HorizontalPodAutoscalers(ns).List(api.ListOptions{}) if err != nil { return err } @@ -482,7 +482,7 @@ func deleteHorizontalPodAutoscalers(expClient client.ExtensionsInterface, ns str } func deleteDaemonSets(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.DaemonSets(ns).List(unversioned.ListOptions{}) + items, err := expClient.DaemonSets(ns).List(api.ListOptions{}) if err != nil { return err } @@ -496,7 +496,7 @@ func deleteDaemonSets(expClient client.ExtensionsInterface, ns string) error { } func deleteJobs(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.Jobs(ns).List(unversioned.ListOptions{}) + items, err := expClient.Jobs(ns).List(api.ListOptions{}) if err != nil { return err } @@ -510,7 +510,7 @@ func deleteJobs(expClient client.ExtensionsInterface, ns string) error { } func deleteDeployments(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.Deployments(ns).List(unversioned.ListOptions{}) + items, err := expClient.Deployments(ns).List(api.ListOptions{}) if err != nil { return err } @@ -524,7 +524,7 @@ func deleteDeployments(expClient client.ExtensionsInterface, ns string) error { } func deleteIngress(expClient client.ExtensionsInterface, ns string) error { - items, err := expClient.Ingress(ns).List(unversioned.ListOptions{}) + items, err := expClient.Ingress(ns).List(api.ListOptions{}) if err != nil { return err } diff --git a/pkg/controller/node/nodecontroller.go b/pkg/controller/node/nodecontroller.go index ba15dca10de..e2c10325007 100644 --- a/pkg/controller/node/nodecontroller.go +++ b/pkg/controller/node/nodecontroller.go @@ -162,10 +162,10 @@ func NewNodeController( nc.podStore.Store, nc.podController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return nc.kubeClient.Pods(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return nc.kubeClient.Pods(api.NamespaceAll).Watch(options) }, }, @@ -178,10 +178,10 @@ func NewNodeController( ) nc.nodeStore.Store, nc.nodeController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return nc.kubeClient.Nodes().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return nc.kubeClient.Nodes().Watch(options) }, }, @@ -354,7 +354,7 @@ func forcefullyDeletePod(c client.Interface, pod *api.Pod) { // post "NodeReady==ConditionUnknown". It also evicts all pods if node is not ready or // not reachable for a long period of time. func (nc *NodeController) monitorNodeStatus() error { - nodes, err := nc.kubeClient.Nodes().List(unversioned.ListOptions{}) + nodes, err := nc.kubeClient.Nodes().List(api.ListOptions{}) if err != nil { return err } @@ -692,7 +692,7 @@ func (nc *NodeController) tryUpdateNodeStatus(node *api.Node) (time.Duration, ap // the server could not be contacted. func (nc *NodeController) hasPods(nodeName string) (bool, error) { selector := fields.OneTermEqualSelector(client.PodHost, nodeName) - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(options) if err != nil { return false, err @@ -727,7 +727,7 @@ func (nc *NodeController) cancelPodEviction(nodeName string) bool { func (nc *NodeController) deletePods(nodeName string) (bool, error) { remaining := false selector := fields.OneTermEqualSelector(client.PodHost, nodeName) - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(options) if err != nil { return remaining, err @@ -767,7 +767,7 @@ func (nc *NodeController) terminatePods(nodeName string, since time.Time) (bool, complete := true selector := fields.OneTermEqualSelector(client.PodHost, nodeName) - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(options) if err != nil { return false, nextAttempt, err diff --git a/pkg/controller/node/nodecontroller_test.go b/pkg/controller/node/nodecontroller_test.go index 192cc040312..3ea10699f68 100644 --- a/pkg/controller/node/nodecontroller_test.go +++ b/pkg/controller/node/nodecontroller_test.go @@ -89,7 +89,7 @@ func (m *FakeNodeHandler) Get(name string) (*api.Node, error) { return nil, nil } -func (m *FakeNodeHandler) List(opts unversioned.ListOptions) (*api.NodeList, error) { +func (m *FakeNodeHandler) List(opts api.ListOptions) (*api.NodeList, error) { defer func() { m.RequestCount++ }() var nodes []*api.Node for i := 0; i < len(m.UpdatedNodes); i++ { @@ -134,7 +134,7 @@ func (m *FakeNodeHandler) UpdateStatus(node *api.Node) (*api.Node, error) { return node, nil } -func (m *FakeNodeHandler) Watch(opts unversioned.ListOptions) (watch.Interface, error) { +func (m *FakeNodeHandler) Watch(opts api.ListOptions) (watch.Interface, error) { return nil, nil } diff --git a/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go b/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go index cdcd154448b..8ca5ea51f21 100644 --- a/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go +++ b/pkg/controller/persistentvolume/persistentvolume_claim_binder_controller.go @@ -23,7 +23,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller/framework" @@ -55,10 +54,10 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time _, volumeController := framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return kubeClient.PersistentVolumes().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return kubeClient.PersistentVolumes().Watch(options) }, }, @@ -73,10 +72,10 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time ) _, claimController := framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return kubeClient.PersistentVolumeClaims(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return kubeClient.PersistentVolumeClaims(api.NamespaceAll).Watch(options) }, }, diff --git a/pkg/controller/persistentvolume/persistentvolume_provisioner_controller.go b/pkg/controller/persistentvolume/persistentvolume_provisioner_controller.go index e0cfa420012..c57e6aecfda 100644 --- a/pkg/controller/persistentvolume/persistentvolume_provisioner_controller.go +++ b/pkg/controller/persistentvolume/persistentvolume_provisioner_controller.go @@ -22,7 +22,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/cloudprovider" @@ -74,10 +73,10 @@ func NewPersistentVolumeProvisionerController(client controllerClient, syncPerio controller.volumeStore, controller.volumeController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return client.ListPersistentVolumes(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return client.WatchPersistentVolumes(options) }, }, @@ -92,10 +91,10 @@ func NewPersistentVolumeProvisionerController(client controllerClient, syncPerio ) controller.claimStore, controller.claimController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return client.ListPersistentVolumeClaims(api.NamespaceAll, options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return client.WatchPersistentVolumeClaims(api.NamespaceAll, options) }, }, @@ -345,16 +344,16 @@ func newProvisioner(plugin volume.ProvisionableVolumePlugin, claim *api.Persiste // controllerClient abstracts access to PVs and PVCs. Easy to mock for testing and wrap for real client. type controllerClient interface { CreatePersistentVolume(pv *api.PersistentVolume) (*api.PersistentVolume, error) - ListPersistentVolumes(options unversioned.ListOptions) (*api.PersistentVolumeList, error) - WatchPersistentVolumes(options unversioned.ListOptions) (watch.Interface, error) + ListPersistentVolumes(options api.ListOptions) (*api.PersistentVolumeList, error) + WatchPersistentVolumes(options api.ListOptions) (watch.Interface, error) GetPersistentVolume(name string) (*api.PersistentVolume, error) UpdatePersistentVolume(volume *api.PersistentVolume) (*api.PersistentVolume, error) DeletePersistentVolume(volume *api.PersistentVolume) error UpdatePersistentVolumeStatus(volume *api.PersistentVolume) (*api.PersistentVolume, error) GetPersistentVolumeClaim(namespace, name string) (*api.PersistentVolumeClaim, error) - ListPersistentVolumeClaims(namespace string, options unversioned.ListOptions) (*api.PersistentVolumeClaimList, error) - WatchPersistentVolumeClaims(namespace string, options unversioned.ListOptions) (watch.Interface, error) + ListPersistentVolumeClaims(namespace string, options api.ListOptions) (*api.PersistentVolumeClaimList, error) + WatchPersistentVolumeClaims(namespace string, options api.ListOptions) (watch.Interface, error) UpdatePersistentVolumeClaim(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) UpdatePersistentVolumeClaimStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) @@ -376,11 +375,11 @@ func (c *realControllerClient) GetPersistentVolume(name string) (*api.Persistent return c.client.PersistentVolumes().Get(name) } -func (c *realControllerClient) ListPersistentVolumes(options unversioned.ListOptions) (*api.PersistentVolumeList, error) { +func (c *realControllerClient) ListPersistentVolumes(options api.ListOptions) (*api.PersistentVolumeList, error) { return c.client.PersistentVolumes().List(options) } -func (c *realControllerClient) WatchPersistentVolumes(options unversioned.ListOptions) (watch.Interface, error) { +func (c *realControllerClient) WatchPersistentVolumes(options api.ListOptions) (watch.Interface, error) { return c.client.PersistentVolumes().Watch(options) } @@ -404,11 +403,11 @@ func (c *realControllerClient) GetPersistentVolumeClaim(namespace, name string) return c.client.PersistentVolumeClaims(namespace).Get(name) } -func (c *realControllerClient) ListPersistentVolumeClaims(namespace string, options unversioned.ListOptions) (*api.PersistentVolumeClaimList, error) { +func (c *realControllerClient) ListPersistentVolumeClaims(namespace string, options api.ListOptions) (*api.PersistentVolumeClaimList, error) { return c.client.PersistentVolumeClaims(namespace).List(options) } -func (c *realControllerClient) WatchPersistentVolumeClaims(namespace string, options unversioned.ListOptions) (watch.Interface, error) { +func (c *realControllerClient) WatchPersistentVolumeClaims(namespace string, options api.ListOptions) (watch.Interface, error) { return c.client.PersistentVolumeClaims(namespace).Watch(options) } diff --git a/pkg/controller/persistentvolume/persistentvolume_provisioner_controller_test.go b/pkg/controller/persistentvolume/persistentvolume_provisioner_controller_test.go index 08eb03383a5..3a15b7ad616 100644 --- a/pkg/controller/persistentvolume/persistentvolume_provisioner_controller_test.go +++ b/pkg/controller/persistentvolume/persistentvolume_provisioner_controller_test.go @@ -25,7 +25,6 @@ import ( "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" fake_cloud "k8s.io/kubernetes/pkg/cloudprovider/providers/fake" "k8s.io/kubernetes/pkg/util" @@ -185,13 +184,13 @@ func (c *mockControllerClient) CreatePersistentVolume(pv *api.PersistentVolume) return c.volume, nil } -func (c *mockControllerClient) ListPersistentVolumes(options unversioned.ListOptions) (*api.PersistentVolumeList, error) { +func (c *mockControllerClient) ListPersistentVolumes(options api.ListOptions) (*api.PersistentVolumeList, error) { return &api.PersistentVolumeList{ Items: []api.PersistentVolume{*c.volume}, }, nil } -func (c *mockControllerClient) WatchPersistentVolumes(options unversioned.ListOptions) (watch.Interface, error) { +func (c *mockControllerClient) WatchPersistentVolumes(options api.ListOptions) (watch.Interface, error) { return watch.NewFake(), nil } @@ -216,13 +215,13 @@ func (c *mockControllerClient) GetPersistentVolumeClaim(namespace, name string) } } -func (c *mockControllerClient) ListPersistentVolumeClaims(namespace string, options unversioned.ListOptions) (*api.PersistentVolumeClaimList, error) { +func (c *mockControllerClient) ListPersistentVolumeClaims(namespace string, options api.ListOptions) (*api.PersistentVolumeClaimList, error) { return &api.PersistentVolumeClaimList{ Items: []api.PersistentVolumeClaim{*c.claim}, }, nil } -func (c *mockControllerClient) WatchPersistentVolumeClaims(namespace string, options unversioned.ListOptions) (watch.Interface, error) { +func (c *mockControllerClient) WatchPersistentVolumeClaims(namespace string, options api.ListOptions) (watch.Interface, error) { return watch.NewFake(), nil } diff --git a/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go b/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go index 629c465e2d4..3d85dac9e6a 100644 --- a/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go +++ b/pkg/controller/persistentvolume/persistentvolume_recycler_controller.go @@ -22,7 +22,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/cloudprovider" @@ -64,10 +63,10 @@ func NewPersistentVolumeRecycler(kubeClient client.Interface, syncPeriod time.Du _, volumeController := framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return kubeClient.PersistentVolumes().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return kubeClient.PersistentVolumes().Watch(options) }, }, diff --git a/pkg/controller/podautoscaler/horizontal.go b/pkg/controller/podautoscaler/horizontal.go index 63219c1c325..979d816b789 100644 --- a/pkg/controller/podautoscaler/horizontal.go +++ b/pkg/controller/podautoscaler/horizontal.go @@ -173,7 +173,7 @@ func (a *HorizontalController) reconcileAutoscaler(hpa extensions.HorizontalPodA func (a *HorizontalController) reconcileAutoscalers() error { ns := api.NamespaceAll - list, err := a.client.Extensions().HorizontalPodAutoscalers(ns).List(unversioned.ListOptions{}) + list, err := a.client.Extensions().HorizontalPodAutoscalers(ns).List(api.ListOptions{}) if err != nil { return fmt.Errorf("error listing nodes: %v", err) } diff --git a/pkg/controller/podautoscaler/metrics/metrics_client.go b/pkg/controller/podautoscaler/metrics/metrics_client.go index cb8ce9c24fe..b3cf4e14e00 100644 --- a/pkg/controller/podautoscaler/metrics/metrics_client.go +++ b/pkg/controller/podautoscaler/metrics/metrics_client.go @@ -25,7 +25,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" @@ -120,7 +119,7 @@ func (h *HeapsterMetricsClient) GetCPUUtilization(namespace string, selector map func (h *HeapsterMetricsClient) GetResourceConsumptionAndRequest(resourceName api.ResourceName, namespace string, selector map[string]string) (consumption *ResourceConsumption, request *resource.Quantity, timestamp time.Time, err error) { labelSelector := labels.SelectorFromSet(labels.Set(selector)) podList, err := h.client.Pods(namespace). - List(unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}}) + List(api.ListOptions{LabelSelector: labelSelector}) if err != nil { return nil, nil, time.Time{}, fmt.Errorf("failed to get pod list: %v", err) diff --git a/pkg/controller/replication/replication_controller.go b/pkg/controller/replication/replication_controller.go index d61541c8ff3..873f9af17fa 100644 --- a/pkg/controller/replication/replication_controller.go +++ b/pkg/controller/replication/replication_controller.go @@ -24,7 +24,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" @@ -107,10 +106,10 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller. rm.rcStore.Store, rm.rcController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return rm.kubeClient.ReplicationControllers(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return rm.kubeClient.ReplicationControllers(api.NamespaceAll).Watch(options) }, }, @@ -148,10 +147,10 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller. rm.podStore.Store, rm.podController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return rm.kubeClient.Pods(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return rm.kubeClient.Pods(api.NamespaceAll).Watch(options) }, }, diff --git a/pkg/controller/resourcequota/resource_quota_controller.go b/pkg/controller/resourcequota/resource_quota_controller.go index ef1cec05343..939d00783a6 100644 --- a/pkg/controller/resourcequota/resource_quota_controller.go +++ b/pkg/controller/resourcequota/resource_quota_controller.go @@ -23,7 +23,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller" @@ -65,10 +64,10 @@ func NewResourceQuotaController(kubeClient client.Interface, resyncPeriod contro rq.rqIndexer, rq.rqController = framework.NewIndexerInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return rq.kubeClient.ResourceQuotas(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return rq.kubeClient.ResourceQuotas(api.NamespaceAll).Watch(options) }, }, @@ -105,10 +104,10 @@ func NewResourceQuotaController(kubeClient client.Interface, resyncPeriod contro // release compute resources from any associated quota. rq.podStore.Store, rq.podController = framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return rq.kubeClient.Pods(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return rq.kubeClient.Pods(api.NamespaceAll).Watch(options) }, }, @@ -265,7 +264,7 @@ func (rq *ResourceQuotaController) syncResourceQuota(quota api.ResourceQuota) (e pods := &api.PodList{} if set[api.ResourcePods] || set[api.ResourceMemory] || set[api.ResourceCPU] { - pods, err = rq.kubeClient.Pods(usage.Namespace).List(unversioned.ListOptions{}) + pods, err = rq.kubeClient.Pods(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } @@ -288,31 +287,31 @@ func (rq *ResourceQuotaController) syncResourceQuota(quota api.ResourceQuota) (e case api.ResourcePods: value = resource.NewQuantity(int64(len(filteredPods)), resource.DecimalSI) case api.ResourceServices: - items, err := rq.kubeClient.Services(usage.Namespace).List(unversioned.ListOptions{}) + items, err := rq.kubeClient.Services(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) case api.ResourceReplicationControllers: - items, err := rq.kubeClient.ReplicationControllers(usage.Namespace).List(unversioned.ListOptions{}) + items, err := rq.kubeClient.ReplicationControllers(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) case api.ResourceQuotas: - items, err := rq.kubeClient.ResourceQuotas(usage.Namespace).List(unversioned.ListOptions{}) + items, err := rq.kubeClient.ResourceQuotas(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) case api.ResourceSecrets: - items, err := rq.kubeClient.Secrets(usage.Namespace).List(unversioned.ListOptions{}) + items, err := rq.kubeClient.Secrets(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI) case api.ResourcePersistentVolumeClaims: - items, err := rq.kubeClient.PersistentVolumeClaims(usage.Namespace).List(unversioned.ListOptions{}) + items, err := rq.kubeClient.PersistentVolumeClaims(usage.Namespace).List(api.ListOptions{}) if err != nil { return err } diff --git a/pkg/controller/route/routecontroller.go b/pkg/controller/route/routecontroller.go index 0d89fbc9de4..a54decba46f 100644 --- a/pkg/controller/route/routecontroller.go +++ b/pkg/controller/route/routecontroller.go @@ -23,7 +23,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/cloudprovider" "k8s.io/kubernetes/pkg/util" @@ -60,7 +59,7 @@ func (rc *RouteController) reconcileNodeRoutes() error { } // TODO (cjcullen): use pkg/controller/framework.NewInformer to watch this // and reduce the number of lists needed. - nodeList, err := rc.kubeClient.Nodes().List(unversioned.ListOptions{}) + nodeList, err := rc.kubeClient.Nodes().List(api.ListOptions{}) if err != nil { return fmt.Errorf("error listing nodes: %v", err) } diff --git a/pkg/controller/serviceaccount/serviceaccounts_controller.go b/pkg/controller/serviceaccount/serviceaccounts_controller.go index b942ecada2a..2cc46eaa3a7 100644 --- a/pkg/controller/serviceaccount/serviceaccounts_controller.go +++ b/pkg/controller/serviceaccount/serviceaccounts_controller.go @@ -24,7 +24,6 @@ import ( "k8s.io/kubernetes/pkg/api" apierrs "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller/framework" @@ -80,12 +79,12 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo } e.serviceAccounts, e.serviceAccountController = framework.NewIndexerInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - options.FieldSelector.Selector = accountSelector + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.FieldSelector = accountSelector return e.client.ServiceAccounts(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.FieldSelector.Selector = accountSelector + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.FieldSelector = accountSelector return e.client.ServiceAccounts(api.NamespaceAll).Watch(options) }, }, @@ -99,10 +98,10 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo e.namespaces, e.namespaceController = framework.NewIndexerInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return e.client.Namespaces().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return e.client.Namespaces().Watch(options) }, }, diff --git a/pkg/controller/serviceaccount/tokens_controller.go b/pkg/controller/serviceaccount/tokens_controller.go index ebabc4f5c52..8f2b917725c 100644 --- a/pkg/controller/serviceaccount/tokens_controller.go +++ b/pkg/controller/serviceaccount/tokens_controller.go @@ -24,7 +24,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" apierrors "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller/framework" @@ -62,10 +61,10 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) * e.serviceAccounts, e.serviceAccountController = framework.NewIndexerInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return e.client.ServiceAccounts(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return e.client.ServiceAccounts(api.NamespaceAll).Watch(options) }, }, @@ -82,12 +81,12 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) * tokenSelector := fields.SelectorFromSet(map[string]string{client.SecretType: string(api.SecretTypeServiceAccountToken)}) e.secrets, e.secretController = framework.NewIndexerInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - options.FieldSelector.Selector = tokenSelector + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.FieldSelector = tokenSelector return e.client.Secrets(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.FieldSelector.Selector = tokenSelector + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.FieldSelector = tokenSelector return e.client.Secrets(api.NamespaceAll).Watch(options) }, }, diff --git a/pkg/kubectl/cmd/util/factory.go b/pkg/kubectl/cmd/util/factory.go index fe61455e9a5..de2c7a667be 100644 --- a/pkg/kubectl/cmd/util/factory.go +++ b/pkg/kubectl/cmd/util/factory.go @@ -346,7 +346,7 @@ func GetFirstPod(client *client.Client, namespace string, selector map[string]st for pods == nil || len(pods.Items) == 0 { var err error labelSelector := labels.SelectorFromSet(selector) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}} + options := api.ListOptions{LabelSelector: labelSelector} if pods, err = client.Pods(namespace).List(options); err != nil { return nil, err } diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go index c204e004176..3f477d3a74f 100644 --- a/pkg/kubectl/describe.go +++ b/pkg/kubectl/describe.go @@ -143,11 +143,11 @@ func (d *NamespaceDescriber) Describe(namespace, name string) (string, error) { if err != nil { return "", err } - resourceQuotaList, err := d.ResourceQuotas(name).List(unversioned.ListOptions{}) + resourceQuotaList, err := d.ResourceQuotas(name).List(api.ListOptions{}) if err != nil { return "", err } - limitRangeList, err := d.LimitRanges(name).List(unversioned.ListOptions{}) + limitRangeList, err := d.LimitRanges(name).List(api.ListOptions{}) if err != nil { return "", err } @@ -425,7 +425,7 @@ func (d *PodDescriber) Describe(namespace, name string) (string, error) { if err != nil { eventsInterface := d.Events(namespace) selector := eventsInterface.GetFieldSelector(&name, &namespace, nil, nil) - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} events, err2 := eventsInterface.List(options) if err2 == nil && len(events.Items) > 0 { return tabbedString(func(out io.Writer) error { @@ -1236,7 +1236,7 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string) (string, erro tokens := []api.Secret{} tokenSelector := fields.SelectorFromSet(map[string]string{client.SecretType: string(api.SecretTypeServiceAccountToken)}) - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{tokenSelector}} + options := api.ListOptions{FieldSelector: tokenSelector} secrets, err := d.Secrets(namespace).List(options) if err == nil { for _, s := range secrets.Items { @@ -1320,7 +1320,7 @@ func (d *NodeDescriber) Describe(namespace, name string) (string, error) { // in a policy aware setting, users may have access to a node, but not all pods // in that case, we note that the user does not have access to the pods canViewPods := true - nodeNonTerminatedPodsList, err := d.Pods(namespace).List(unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{fieldSelector}}) + nodeNonTerminatedPodsList, err := d.Pods(namespace).List(api.ListOptions{FieldSelector: fieldSelector}) if err != nil { if !errors.IsForbidden(err) { return "", err @@ -1596,7 +1596,7 @@ func (dd *DeploymentDescriber) Describe(namespace, name string) (string, error) func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.Labels) ([]extensions.DaemonSet, error) { // Get all daemon sets // TODO: this needs a namespace scope as argument - dss, err := c.List(unversioned.ListOptions{}) + dss, err := c.List(api.ListOptions{}) if err != nil { return nil, fmt.Errorf("error getting daemon set: %v", err) } @@ -1623,7 +1623,7 @@ func getDaemonSetsForLabels(c client.DaemonSetInterface, labelsToMatch labels.La func getReplicationControllersForLabels(c client.ReplicationControllerInterface, labelsToMatch labels.Labels) ([]api.ReplicationController, error) { // Get all replication controllers. // TODO this needs a namespace scope as argument - rcs, err := c.List(unversioned.ListOptions{}) + rcs, err := c.List(api.ListOptions{}) if err != nil { return nil, fmt.Errorf("error getting replication controllers: %v", err) } @@ -1654,7 +1654,7 @@ func printReplicationControllersByLabels(matchingRCs []*api.ReplicationControlle } func getPodStatusForController(c client.PodInterface, selector labels.Selector) (running, waiting, succeeded, failed int, err error) { - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} rcPods, err := c.List(options) if err != nil { return diff --git a/pkg/kubectl/rolling_updater.go b/pkg/kubectl/rolling_updater.go index 6162087cc59..63e11956cf4 100644 --- a/pkg/kubectl/rolling_updater.go +++ b/pkg/kubectl/rolling_updater.go @@ -27,7 +27,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/runtime" @@ -364,7 +363,7 @@ func (r *RollingUpdater) pollForReadyPods(interval, timeout time.Duration, oldRc anyReady := false for _, controller := range controllers { selector := labels.Set(controller.Spec.Selector).AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} pods, err := r.c.Pods(controller.Namespace).List(options) if err != nil { return false, err @@ -647,7 +646,7 @@ func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, c // Update all pods managed by the rc to have the new hash label, so they are correctly adopted // TODO: extract the code from the label command and re-use it here. selector := labels.SelectorFromSet(oldRc.Spec.Selector) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} podList, err := client.Pods(namespace).List(options) if err != nil { return nil, err @@ -699,7 +698,7 @@ func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, c // doesn't see the update to its pod template and creates a new pod with the old labels after // we've finished re-adopting existing pods to the rc. selector = labels.SelectorFromSet(selectorCopy) - options = unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options = api.ListOptions{LabelSelector: selector} podList, err = client.Pods(namespace).List(options) for ix := range podList.Items { pod := &podList.Items[ix] @@ -741,7 +740,7 @@ func updateWithRetries(rcClient client.ReplicationControllerInterface, rc *api.R } func FindSourceController(r client.ReplicationControllersNamespacer, namespace, name string) (*api.ReplicationController, error) { - list, err := r.ReplicationControllers(namespace).List(unversioned.ListOptions{}) + list, err := r.ReplicationControllers(namespace).List(api.ListOptions{}) if err != nil { return nil, err } diff --git a/pkg/kubectl/stop.go b/pkg/kubectl/stop.go index e2f8797e713..4a85d8b6687 100644 --- a/pkg/kubectl/stop.go +++ b/pkg/kubectl/stop.go @@ -108,7 +108,7 @@ type objInterface interface { // getOverlappingControllers finds rcs that this controller overlaps, as well as rcs overlapping this controller. func getOverlappingControllers(c client.ReplicationControllerInterface, rc *api.ReplicationController) ([]api.ReplicationController, error) { - rcs, err := c.List(unversioned.ListOptions{}) + rcs, err := c.List(api.ListOptions{}) if err != nil { return nil, fmt.Errorf("error getting replication controllers: %v", err) } @@ -251,7 +251,7 @@ func (reaper *JobReaper) Stop(namespace, name string, timeout time.Duration, gra } // at this point only dead pods are left, that should be removed selector, _ := extensions.LabelSelectorAsSelector(job.Spec.Selector) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} podList, err := pods.List(options) if err != nil { return err diff --git a/pkg/kubelet/config/apiserver_test.go b/pkg/kubelet/config/apiserver_test.go index 9ae5a6ea596..d7be8a7fed5 100644 --- a/pkg/kubelet/config/apiserver_test.go +++ b/pkg/kubelet/config/apiserver_test.go @@ -20,7 +20,6 @@ import ( "testing" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" kubetypes "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/kubernetes/pkg/runtime" @@ -32,11 +31,11 @@ type fakePodLW struct { watchResp watch.Interface } -func (lw fakePodLW) List(options unversioned.ListOptions) (runtime.Object, error) { +func (lw fakePodLW) List(options api.ListOptions) (runtime.Object, error) { return lw.listResp, nil } -func (lw fakePodLW) Watch(options unversioned.ListOptions) (watch.Interface, error) { +func (lw fakePodLW) Watch(options api.ListOptions) (watch.Interface, error) { return lw.watchResp, nil } diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index d4f98079ff3..46ed6d333fe 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -233,10 +233,10 @@ func NewMainKubelet( // TODO: cache.NewListWatchFromClient is limited as it takes a client implementation rather // than an interface. There is no way to construct a list+watcher using resource name. listWatch := &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return kubeClient.Services(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return kubeClient.Services(api.NamespaceAll).Watch(options) }, } @@ -250,12 +250,12 @@ func NewMainKubelet( // than an interface. There is no way to construct a list+watcher using resource name. fieldSelector := fields.Set{client.ObjectNameField: nodeName}.AsSelector() listWatch := &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - options.FieldSelector.Selector = fieldSelector + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.FieldSelector = fieldSelector return kubeClient.Nodes().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.FieldSelector.Selector = fieldSelector + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.FieldSelector = fieldSelector return kubeClient.Nodes().Watch(options) }, } diff --git a/pkg/proxy/config/api_test.go b/pkg/proxy/config/api_test.go index cfa6a35f316..6e5b0e11d48 100644 --- a/pkg/proxy/config/api_test.go +++ b/pkg/proxy/config/api_test.go @@ -21,7 +21,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/runtime" "k8s.io/kubernetes/pkg/watch" @@ -32,11 +31,11 @@ type fakeLW struct { watchResp watch.Interface } -func (lw fakeLW) List(options unversioned.ListOptions) (runtime.Object, error) { +func (lw fakeLW) List(options api.ListOptions) (runtime.Object, error) { return lw.listResp, nil } -func (lw fakeLW) Watch(options unversioned.ListOptions) (watch.Interface, error) { +func (lw fakeLW) Watch(options api.ListOptions) (watch.Interface, error) { return lw.watchResp, nil } diff --git a/pkg/storage/cacher.go b/pkg/storage/cacher.go index 6defe84faac..0149fb60ed7 100644 --- a/pkg/storage/cacher.go +++ b/pkg/storage/cacher.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/meta" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/conversion" "k8s.io/kubernetes/pkg/runtime" @@ -392,7 +391,7 @@ func newCacherListerWatcher(storage Interface, resourcePrefix string, newListFun } // Implements cache.ListerWatcher interface. -func (lw *cacherListerWatcher) List(options unversioned.ListOptions) (runtime.Object, error) { +func (lw *cacherListerWatcher) List(options api.ListOptions) (runtime.Object, error) { list := lw.newListFunc() if err := lw.storage.List(context.TODO(), lw.resourcePrefix, "", Everything, list); err != nil { return nil, err @@ -401,7 +400,7 @@ func (lw *cacherListerWatcher) List(options unversioned.ListOptions) (runtime.Ob } // Implements cache.ListerWatcher interface. -func (lw *cacherListerWatcher) Watch(options unversioned.ListOptions) (watch.Interface, error) { +func (lw *cacherListerWatcher) Watch(options api.ListOptions) (watch.Interface, error) { return lw.storage.WatchList(context.TODO(), lw.resourcePrefix, options.ResourceVersion, Everything) } diff --git a/pkg/storage/watch_cache_test.go b/pkg/storage/watch_cache_test.go index 91140db9577..a96fd1a1ce9 100644 --- a/pkg/storage/watch_cache_test.go +++ b/pkg/storage/watch_cache_test.go @@ -249,14 +249,14 @@ func TestWaitUntilFreshAndList(t *testing.T) { } type testLW struct { - ListFunc func(options unversioned.ListOptions) (runtime.Object, error) - WatchFunc func(options unversioned.ListOptions) (watch.Interface, error) + ListFunc func(options api.ListOptions) (runtime.Object, error) + WatchFunc func(options api.ListOptions) (watch.Interface, error) } -func (t *testLW) List(options unversioned.ListOptions) (runtime.Object, error) { +func (t *testLW) List(options api.ListOptions) (runtime.Object, error) { return t.ListFunc(options) } -func (t *testLW) Watch(options unversioned.ListOptions) (watch.Interface, error) { +func (t *testLW) Watch(options api.ListOptions) (watch.Interface, error) { return t.WatchFunc(options) } @@ -271,12 +271,12 @@ func TestReflectorForWatchCache(t *testing.T) { } lw := &testLW{ - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { fw := watch.NewFake() go fw.Stop() return fw, nil }, - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return &api.PodList{ListMeta: unversioned.ListMeta{ResourceVersion: "10"}}, nil }, } diff --git a/pkg/util/deployment/deployment.go b/pkg/util/deployment/deployment.go index 1df33e97084..51f0762895a 100644 --- a/pkg/util/deployment/deployment.go +++ b/pkg/util/deployment/deployment.go @@ -22,7 +22,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" @@ -34,7 +33,7 @@ func GetOldRCs(deployment extensions.Deployment, c client.Interface) ([]*api.Rep namespace := deployment.ObjectMeta.Namespace // 1. Find all pods whose labels match deployment.Spec.Selector selector := labels.SelectorFromSet(deployment.Spec.Selector) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} podList, err := c.Pods(namespace).List(options) if err != nil { return nil, fmt.Errorf("error listing pods: %v", err) @@ -42,7 +41,7 @@ func GetOldRCs(deployment extensions.Deployment, c client.Interface) ([]*api.Rep // 2. Find the corresponding RCs for pods in podList. // TODO: Right now we list all RCs and then filter. We should add an API for this. oldRCs := map[string]api.ReplicationController{} - rcList, err := c.ReplicationControllers(namespace).List(unversioned.ListOptions{}) + rcList, err := c.ReplicationControllers(namespace).List(api.ListOptions{}) if err != nil { return nil, fmt.Errorf("error listing replication controllers: %v", err) } @@ -75,7 +74,7 @@ func GetOldRCs(deployment extensions.Deployment, c client.Interface) ([]*api.Rep // Returns nil if the new RC doesnt exist yet. func GetNewRC(deployment extensions.Deployment, c client.Interface) (*api.ReplicationController, error) { namespace := deployment.ObjectMeta.Namespace - rcList, err := c.ReplicationControllers(namespace).List(unversioned.ListOptions{}) + rcList, err := c.ReplicationControllers(namespace).List(api.ListOptions{}) if err != nil { return nil, fmt.Errorf("error listing replication controllers: %v", err) } @@ -173,7 +172,7 @@ func getPodsForRCs(c client.Interface, replicationControllers []*api.Replication allPods := []api.Pod{} for _, rc := range replicationControllers { selector := labels.SelectorFromSet(rc.Spec.Selector) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} podList, err := c.Pods(rc.ObjectMeta.Namespace).List(options) if err != nil { return allPods, fmt.Errorf("error listing pods: %v", err) diff --git a/pkg/volume/util.go b/pkg/volume/util.go index 5b1df005db2..7a92ae7f875 100644 --- a/pkg/volume/util.go +++ b/pkg/volume/util.go @@ -21,7 +21,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/fields" @@ -108,12 +107,12 @@ func (c *realRecyclerClient) WatchPod(name, namespace, resourceVersion string, s fieldSelector, _ := fields.ParseSelector("metadata.name=" + name) podLW := &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - options.FieldSelector.Selector = fieldSelector + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.FieldSelector = fieldSelector return c.client.Pods(namespace).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.FieldSelector.Selector = fieldSelector + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.FieldSelector = fieldSelector return c.client.Pods(namespace).Watch(options) }, } diff --git a/plugin/pkg/admission/limitranger/admission.go b/plugin/pkg/admission/limitranger/admission.go index 50f465b53fa..775d75cf0e0 100644 --- a/plugin/pkg/admission/limitranger/admission.go +++ b/plugin/pkg/admission/limitranger/admission.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/api/resource" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" @@ -97,10 +96,10 @@ func (l *limitRanger) Admit(a admission.Attributes) (err error) { // NewLimitRanger returns an object that enforces limits based on the supplied limit function func NewLimitRanger(client client.Interface, limitFunc LimitFunc) admission.Interface { lw := &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return client.LimitRanges(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return client.LimitRanges(api.NamespaceAll).Watch(options) }, } diff --git a/plugin/pkg/admission/namespace/autoprovision/admission.go b/plugin/pkg/admission/namespace/autoprovision/admission.go index 2de5d4203eb..f4886d6a9c4 100644 --- a/plugin/pkg/admission/namespace/autoprovision/admission.go +++ b/plugin/pkg/admission/namespace/autoprovision/admission.go @@ -23,7 +23,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" @@ -83,10 +82,10 @@ func NewProvision(c client.Interface) admission.Interface { store := cache.NewStore(cache.MetaNamespaceKeyFunc) reflector := cache.NewReflector( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return c.Namespaces().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return c.Namespaces().Watch(options) }, }, diff --git a/plugin/pkg/admission/namespace/exists/admission.go b/plugin/pkg/admission/namespace/exists/admission.go index 8d75eabddef..22de7828b3c 100644 --- a/plugin/pkg/admission/namespace/exists/admission.go +++ b/plugin/pkg/admission/namespace/exists/admission.go @@ -24,7 +24,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" @@ -90,10 +89,10 @@ func NewExists(c client.Interface) admission.Interface { store := cache.NewStore(cache.MetaNamespaceKeyFunc) reflector := cache.NewReflector( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return c.Namespaces().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return c.Namespaces().Watch(options) }, }, diff --git a/plugin/pkg/admission/namespace/lifecycle/admission.go b/plugin/pkg/admission/namespace/lifecycle/admission.go index d169f9aff07..793a1e2c6c5 100644 --- a/plugin/pkg/admission/namespace/lifecycle/admission.go +++ b/plugin/pkg/admission/namespace/lifecycle/admission.go @@ -25,7 +25,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/meta" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/runtime" @@ -107,10 +106,10 @@ func NewLifecycle(c client.Interface) admission.Interface { store := cache.NewStore(cache.MetaNamespaceKeyFunc) reflector := cache.NewReflector( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return c.Namespaces().List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return c.Namespaces().Watch(options) }, }, diff --git a/plugin/pkg/admission/resourcequota/admission.go b/plugin/pkg/admission/resourcequota/admission.go index d7f3047ecc2..736819544e8 100644 --- a/plugin/pkg/admission/resourcequota/admission.go +++ b/plugin/pkg/admission/resourcequota/admission.go @@ -49,10 +49,10 @@ type quota struct { // NewResourceQuota creates a new resource quota admission control handler func NewResourceQuota(client client.Interface) admission.Interface { lw := &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return client.ResourceQuotas(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return client.ResourceQuotas(api.NamespaceAll).Watch(options) }, } diff --git a/plugin/pkg/admission/serviceaccount/admission.go b/plugin/pkg/admission/serviceaccount/admission.go index 1b991cf06ea..847c78d3c63 100644 --- a/plugin/pkg/admission/serviceaccount/admission.go +++ b/plugin/pkg/admission/serviceaccount/admission.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/admission" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/controller/serviceaccount" @@ -90,10 +89,10 @@ type serviceAccount struct { func NewServiceAccount(cl client.Interface) *serviceAccount { serviceAccountsIndexer, serviceAccountsReflector := cache.NewNamespaceKeyedIndexerAndReflector( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return cl.ServiceAccounts(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return cl.ServiceAccounts(api.NamespaceAll).Watch(options) }, }, @@ -104,12 +103,12 @@ func NewServiceAccount(cl client.Interface) *serviceAccount { tokenSelector := fields.SelectorFromSet(map[string]string{client.SecretType: string(api.SecretTypeServiceAccountToken)}) secretsIndexer, secretsReflector := cache.NewNamespaceKeyedIndexerAndReflector( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - options.FieldSelector.Selector = tokenSelector + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.FieldSelector = tokenSelector return cl.Secrets(api.NamespaceAll).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.FieldSelector.Selector = tokenSelector + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.FieldSelector = tokenSelector return cl.Secrets(api.NamespaceAll).Watch(options) }, }, diff --git a/test/e2e/cadvisor.go b/test/e2e/cadvisor.go index 14a11cbacef..95783e0f1d2 100644 --- a/test/e2e/cadvisor.go +++ b/test/e2e/cadvisor.go @@ -20,7 +20,7 @@ import ( "fmt" "time" - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" . "github.com/onsi/ginkgo" @@ -48,7 +48,7 @@ var _ = Describe("Cadvisor", func() { func CheckCadvisorHealthOnAllNodes(c *client.Client, timeout time.Duration) { By("getting list of nodes") - nodeList, err := c.Nodes().List(unversioned.ListOptions{}) + nodeList, err := c.Nodes().List(api.ListOptions{}) expectNoError(err) var errors []error retries := maxRetries diff --git a/test/e2e/cluster_size_autoscaling.go b/test/e2e/cluster_size_autoscaling.go index fa1f11803f1..5e2a25f1156 100644 --- a/test/e2e/cluster_size_autoscaling.go +++ b/test/e2e/cluster_size_autoscaling.go @@ -22,7 +22,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -42,7 +41,7 @@ var _ = Describe("[Autoscaling] [Skipped]", func() { BeforeEach(func() { SkipUnlessProviderIs("gce") - nodes, err := f.Client.Nodes().List(unversioned.ListOptions{}) + nodes, err := f.Client.Nodes().List(api.ListOptions{}) expectNoError(err) nodeCount = len(nodes.Items) Expect(nodeCount).NotTo(BeZero()) diff --git a/test/e2e/cluster_upgrade.go b/test/e2e/cluster_upgrade.go index 3b6d2eecedb..1f6edca76f1 100644 --- a/test/e2e/cluster_upgrade.go +++ b/test/e2e/cluster_upgrade.go @@ -29,7 +29,6 @@ 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" "k8s.io/kubernetes/pkg/labels" @@ -418,7 +417,7 @@ func runCmd(command string, args ...string) (string, string, error) { func validate(f *Framework, svcNameWant, rcNameWant string, ingress api.LoadBalancerIngress, podsWant int) error { Logf("Beginning cluster validation") // Verify RC. - rcs, err := f.Client.ReplicationControllers(f.Namespace.Name).List(unversioned.ListOptions{}) + rcs, err := f.Client.ReplicationControllers(f.Namespace.Name).List(api.ListOptions{}) if err != nil { return fmt.Errorf("error listing RCs: %v", err) } diff --git a/test/e2e/daemon_restart.go b/test/e2e/daemon_restart.go index c514457e0d4..ac2b354718d 100644 --- a/test/e2e/daemon_restart.go +++ b/test/e2e/daemon_restart.go @@ -22,7 +22,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" client "k8s.io/kubernetes/pkg/client/unversioned" controllerframework "k8s.io/kubernetes/pkg/controller/framework" @@ -170,7 +169,7 @@ func replacePods(pods []*api.Pod, store cache.Store) { // getContainerRestarts returns the count of container restarts across all pods matching the given labelSelector, // and a list of nodenames across which these containers restarted. func getContainerRestarts(c *client.Client, ns string, labelSelector labels.Selector) (int, []string) { - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}} + options := api.ListOptions{LabelSelector: labelSelector} pods, err := c.Pods(ns).List(options) expectNoError(err) failedContainers := 0 @@ -220,12 +219,12 @@ var _ = Describe("DaemonRestart", func() { tracker = newPodTracker() newPods, controller = controllerframework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - options.LabelSelector.Selector = labelSelector + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.LabelSelector = labelSelector return framework.Client.Pods(ns).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.LabelSelector.Selector = labelSelector + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.LabelSelector = labelSelector return framework.Client.Pods(ns).Watch(options) }, }, diff --git a/test/e2e/daemon_set.go b/test/e2e/daemon_set.go index dc2d018a3b3..ce06434719a 100644 --- a/test/e2e/daemon_set.go +++ b/test/e2e/daemon_set.go @@ -114,7 +114,7 @@ var _ = Describe("Daemon set", func() { podClient := c.Pods(ns) selector := labels.Set(label).AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} podList, err := podClient.List(options) Expect(err).NotTo(HaveOccurred()) Expect(len(podList.Items)).To(BeNumerically(">", 0)) @@ -161,7 +161,7 @@ var _ = Describe("Daemon set", func() { By("Change label of node, check that daemon pod is launched.") nodeClient := c.Nodes() - nodeList, err := nodeClient.List(unversioned.ListOptions{}) + nodeList, err := nodeClient.List(api.ListOptions{}) Expect(len(nodeList.Items)).To(BeNumerically(">", 0)) newNode, err := setDaemonSetNodeLabels(c, nodeList.Items[0].Name, nodeSelector) Expect(err).NotTo(HaveOccurred(), "error setting labels on node") @@ -197,7 +197,7 @@ func separateDaemonSetNodeLabels(labels map[string]string) (map[string]string, m func clearDaemonSetNodeLabels(c *client.Client) error { nodeClient := c.Nodes() - nodeList, err := nodeClient.List(unversioned.ListOptions{}) + nodeList, err := nodeClient.List(api.ListOptions{}) if err != nil { return err } @@ -253,7 +253,7 @@ func setDaemonSetNodeLabels(c *client.Client, nodeName string, labels map[string func checkDaemonPodOnNodes(f *Framework, selector map[string]string, nodeNames []string) func() (bool, error) { return func() (bool, error) { selector := labels.Set(selector).AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} podList, err := f.Client.Pods(f.Namespace.Name).List(options) if err != nil { return false, nil @@ -282,7 +282,7 @@ func checkDaemonPodOnNodes(f *Framework, selector map[string]string, nodeNames [ func checkRunningOnAllNodes(f *Framework, selector map[string]string) func() (bool, error) { return func() (bool, error) { - nodeList, err := f.Client.Nodes().List(unversioned.ListOptions{}) + nodeList, err := f.Client.Nodes().List(api.ListOptions{}) if err != nil { return false, nil } diff --git a/test/e2e/density.go b/test/e2e/density.go index ce33313703e..1436599f39f 100644 --- a/test/e2e/density.go +++ b/test/e2e/density.go @@ -158,7 +158,7 @@ var _ = Describe("Density [Skipped]", func() { ns = framework.Namespace.Name var err error - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) expectNoError(err) nodeCount = len(nodes.Items) Expect(nodeCount).NotTo(BeZero()) @@ -235,10 +235,10 @@ var _ = Describe("Density [Skipped]", func() { events := make([](*api.Event), 0) _, controller := controllerframework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return c.Events(ns).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return c.Events(ns).Watch(options) }, }, @@ -318,13 +318,12 @@ var _ = Describe("Density [Skipped]", func() { additionalPodsPrefix = "density-latency-pod-" + string(util.NewUUID()) _, controller := controllerframework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - selector := labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) - options.LabelSelector.Selector = selector + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.LabelSelector = labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) return c.Pods(ns).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.LabelSelector.Selector = labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.LabelSelector = labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) return c.Pods(ns).Watch(options) }, }, @@ -373,7 +372,7 @@ var _ = Describe("Density [Skipped]", func() { "involvedObject.namespace": ns, "source": "scheduler", }.AsSelector() - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} schedEvents, err := c.Events(ns).List(options) expectNoError(err) for k := range createTimes { diff --git a/test/e2e/dns.go b/test/e2e/dns.go index 3f4be7d3123..1195d02016f 100644 --- a/test/e2e/dns.go +++ b/test/e2e/dns.go @@ -190,7 +190,7 @@ var _ = Describe("DNS", func() { systemClient := f.Client.Pods(api.NamespaceSystem) By("Waiting for DNS Service to be Running") - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{dnsServiceLableSelector}} + options := api.ListOptions{LabelSelector: dnsServiceLableSelector} dnsPods, err := systemClient.List(options) if err != nil { Failf("Failed to list all dns service pods") @@ -229,7 +229,7 @@ var _ = Describe("DNS", func() { systemClient := f.Client.Pods(api.NamespaceSystem) By("Waiting for DNS Service to be Running") - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{dnsServiceLableSelector}} + options := api.ListOptions{LabelSelector: dnsServiceLableSelector} dnsPods, err := systemClient.List(options) if err != nil { Failf("Failed to list all dns service pods") diff --git a/test/e2e/es_cluster_logging.go b/test/e2e/es_cluster_logging.go index b85dabd92a8..6af93699e40 100644 --- a/test/e2e/es_cluster_logging.go +++ b/test/e2e/es_cluster_logging.go @@ -24,7 +24,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/labels" . "github.com/onsi/ginkgo" @@ -85,7 +84,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) { // Wait for the Elasticsearch pods to enter the running state. By("Checking to make sure the Elasticsearch pods are running") label := labels.SelectorFromSet(labels.Set(map[string]string{esKey: esValue})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err := f.Client.Pods(api.NamespaceSystem).List(options) Expect(err).NotTo(HaveOccurred()) for _, pod := range pods.Items { @@ -182,7 +181,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) { } // Obtain a list of nodes so we can place one synthetic logger on each node. - nodes, err := f.Client.Nodes().List(unversioned.ListOptions{}) + nodes, err := f.Client.Nodes().List(api.ListOptions{}) if err != nil { Failf("Failed to list nodes: %v", err) } @@ -270,7 +269,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) { // Debugging code to report the status of the elasticsearch logging endpoints. selector := labels.Set{esKey: esValue}.AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} esPods, err := f.Client.Pods(api.NamespaceSystem).List(options) if err != nil { Logf("Attempt to list Elasticsearch nodes encountered a problem -- may retry: %v", err) diff --git a/test/e2e/etcd_failure.go b/test/e2e/etcd_failure.go index bb576d43502..166adf393aa 100644 --- a/test/e2e/etcd_failure.go +++ b/test/e2e/etcd_failure.go @@ -20,7 +20,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/util/wait" @@ -108,7 +107,7 @@ func checkExistingRCRecovers(f *Framework) { By("deleting pods from existing replication controller") expectNoError(wait.Poll(time.Millisecond*500, time.Second*60, func() (bool, error) { - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{rcSelector}} + options := api.ListOptions{LabelSelector: rcSelector} pods, err := podClient.List(options) if err != nil { Logf("apiserver returned error, as expected before recovery: %v", err) @@ -127,7 +126,7 @@ func checkExistingRCRecovers(f *Framework) { By("waiting for replication controller to recover") expectNoError(wait.Poll(time.Millisecond*500, time.Second*60, func() (bool, error) { - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{rcSelector}} + options := api.ListOptions{LabelSelector: rcSelector} pods, err := podClient.List(options) Expect(err).NotTo(HaveOccurred()) for _, pod := range pods.Items { diff --git a/test/e2e/events.go b/test/e2e/events.go index 26ca4a26015..ca6e24e8336 100644 --- a/test/e2e/events.go +++ b/test/e2e/events.go @@ -22,7 +22,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/util" @@ -74,7 +73,7 @@ var _ = Describe("Events", func() { By("verifying the pod is in kubernetes") selector := labels.SelectorFromSet(labels.Set(map[string]string{"time": value})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} pods, err := podClient.List(options) Expect(len(pods.Items)).To(Equal(1)) @@ -94,7 +93,7 @@ var _ = Describe("Events", func() { "involvedObject.namespace": framework.Namespace.Name, "source": "scheduler", }.AsSelector() - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} events, err := framework.Client.Events(framework.Namespace.Name).List(options) if err != nil { return false, err @@ -114,7 +113,7 @@ var _ = Describe("Events", func() { "involvedObject.namespace": framework.Namespace.Name, "source": "kubelet", }.AsSelector() - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} events, err = framework.Client.Events(framework.Namespace.Name).List(options) if err != nil { return false, err diff --git a/test/e2e/example_cluster_dns.go b/test/e2e/example_cluster_dns.go index 22ed667dc0b..5351597932b 100644 --- a/test/e2e/example_cluster_dns.go +++ b/test/e2e/example_cluster_dns.go @@ -22,7 +22,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" @@ -104,7 +103,7 @@ var _ = Describe("[Example] ClusterDns", func() { // the application itself may have not been initialized. Just query the application. for _, ns := range namespaces { label := labels.SelectorFromSet(labels.Set(map[string]string{"name": backendRcName})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err := c.Pods(ns.Name).List(options) Expect(err).NotTo(HaveOccurred()) err = podsResponding(c, ns.Name, backendPodName, false, pods) @@ -124,7 +123,7 @@ var _ = Describe("[Example] ClusterDns", func() { // dns error or timeout. // This code is probably unnecessary, but let's stay on the safe side. label := labels.SelectorFromSet(labels.Set(map[string]string{"name": backendPodName})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err := c.Pods(namespaces[0].Name).List(options) if err != nil || pods == nil || len(pods.Items) == 0 { diff --git a/test/e2e/example_k8petstore.go b/test/e2e/example_k8petstore.go index 2605aeb59a7..9bae8978f81 100644 --- a/test/e2e/example_k8petstore.go +++ b/test/e2e/example_k8petstore.go @@ -20,7 +20,7 @@ import ( "fmt" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" "log" "os" @@ -156,7 +156,7 @@ var _ = Describe("[Example] Pet Store [Skipped]", func() { f := NewFramework("petstore") It(fmt.Sprintf("should scale to persist a nominal number ( %v ) of transactions in %v seconds", k8bpsSmokeTestTransactions, k8bpsSmokeTestTimeout), func() { - minions, err := f.Client.Nodes().List(unversioned.ListOptions{}) + minions, err := f.Client.Nodes().List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred()) minionCount = len(minions.Items) diff --git a/test/e2e/examples.go b/test/e2e/examples.go index 6eb35382aeb..fc371e42a08 100644 --- a/test/e2e/examples.go +++ b/test/e2e/examples.go @@ -25,7 +25,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" @@ -463,7 +462,7 @@ func forEachPod(c *client.Client, ns, selectorKey, selectorValue string, fn func pods := []*api.Pod{} for t := time.Now(); time.Since(t) < podListTimeout; time.Sleep(poll) { selector := labels.SelectorFromSet(labels.Set(map[string]string{selectorKey: selectorValue})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} podList, err := c.Pods(ns).List(options) Expect(err).NotTo(HaveOccurred()) for _, pod := range podList.Items { diff --git a/test/e2e/framework.go b/test/e2e/framework.go index ee2ec8a2e8f..7ef6dcfb963 100644 --- a/test/e2e/framework.go +++ b/test/e2e/framework.go @@ -24,7 +24,6 @@ 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" @@ -109,7 +108,7 @@ func (f *Framework) afterEach() { // Print events if the test failed. if CurrentGinkgoTestDescription().Failed { By(fmt.Sprintf("Collecting events from namespace %q.", f.Namespace.Name)) - events, err := f.Client.Events(f.Namespace.Name).List(unversioned.ListOptions{}) + events, err := f.Client.Events(f.Namespace.Name).List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred()) for _, e := range events.Items { @@ -183,7 +182,7 @@ func (f *Framework) WaitForAnEndpoint(serviceName string) error { for { // TODO: Endpoints client should take a field selector so we // don't have to list everything. - list, err := f.Client.Endpoints(f.Namespace.Name).List(unversioned.ListOptions{}) + list, err := f.Client.Endpoints(f.Namespace.Name).List(api.ListOptions{}) if err != nil { return err } @@ -198,8 +197,8 @@ func (f *Framework) WaitForAnEndpoint(serviceName string) error { } } - options := unversioned.ListOptions{ - FieldSelector: unversioned.FieldSelector{fields.Set{"metadata.name": serviceName}.AsSelector()}, + options := api.ListOptions{ + FieldSelector: fields.Set{"metadata.name": serviceName}.AsSelector(), ResourceVersion: rv, } w, err := f.Client.Endpoints(f.Namespace.Name).Watch(options) diff --git a/test/e2e/garbage_collector.go b/test/e2e/garbage_collector.go index a9e05b71f28..2fd02e5fce3 100644 --- a/test/e2e/garbage_collector.go +++ b/test/e2e/garbage_collector.go @@ -23,7 +23,6 @@ import ( . "github.com/onsi/gomega" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/util" ) @@ -55,7 +54,7 @@ var _ = Describe("Garbage collector", func() { // 20 seconds. time.Sleep(30 * time.Second) - pods, err := f.Client.Pods(f.Namespace.Name).List(unversioned.ListOptions{}) + pods, err := f.Client.Pods(f.Namespace.Name).List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred()) Expect(len(pods.Items)).To(BeNumerically("==", 100)) }) diff --git a/test/e2e/ingress.go b/test/e2e/ingress.go index 9cc31742b89..04574f85bbf 100644 --- a/test/e2e/ingress.go +++ b/test/e2e/ingress.go @@ -28,7 +28,6 @@ import ( compute "google.golang.org/api/compute/v1" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" @@ -211,7 +210,7 @@ func gcloudDelete(resource, name, project string) { // kubectlLogLBController logs kubectl debug output for the L7 controller pod. func kubectlLogLBController(c *client.Client, ns string) { selector := labels.SelectorFromSet(labels.Set(controllerLabels)) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} podList, err := c.Pods(api.NamespaceAll).List(options) if err != nil { Logf("Cannot log L7 controller output, error listing pods %v", err) @@ -426,7 +425,7 @@ var _ = Describe("GCE L7 LoadBalancer Controller", func() { Logf(desc) } // Delete all Ingress, then wait for the controller to cleanup. - ings, err := client.Extensions().Ingress(ns).List(unversioned.ListOptions{}) + ings, err := client.Extensions().Ingress(ns).List(api.ListOptions{}) if err != nil { Logf("WARNING: Failed to list ingress: %+v", err) } else { @@ -484,7 +483,7 @@ var _ = Describe("GCE L7 LoadBalancer Controller", func() { createIngress(client, ns, appID, appsPerIngress) } - ings, err := client.Extensions().Ingress(ns).List(unversioned.ListOptions{}) + ings, err := client.Extensions().Ingress(ns).List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred()) for _, ing := range ings.Items { diff --git a/test/e2e/job.go b/test/e2e/job.go index 4f19f8bdfbc..5623b73820b 100644 --- a/test/e2e/job.go +++ b/test/e2e/job.go @@ -21,7 +21,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apis/extensions" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/kubectl" @@ -259,7 +258,7 @@ func deleteJob(c *client.Client, ns, name string) error { func waitForAllPodsRunning(c *client.Client, ns, jobName string, parallelism int) error { label := labels.SelectorFromSet(labels.Set(map[string]string{jobSelectorKey: jobName})) return wait.Poll(poll, jobTimeout, func() (bool, error) { - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err := c.Pods(ns).List(options) if err != nil { return false, err diff --git a/test/e2e/kibana_logging.go b/test/e2e/kibana_logging.go index 3c9c7967fb4..7374f7a3d36 100644 --- a/test/e2e/kibana_logging.go +++ b/test/e2e/kibana_logging.go @@ -20,7 +20,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/labels" . "github.com/onsi/ginkgo" @@ -69,7 +68,7 @@ func ClusterLevelLoggingWithKibana(f *Framework) { // Wait for the Kibana pod(s) to enter the running state. By("Checking to make sure the Kibana pods are running") label := labels.SelectorFromSet(labels.Set(map[string]string{kibanaKey: kibanaValue})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err := f.Client.Pods(api.NamespaceSystem).List(options) Expect(err).NotTo(HaveOccurred()) for _, pod := range pods.Items { diff --git a/test/e2e/kubectl.go b/test/e2e/kubectl.go index 5a612450f43..f795a35fcdd 100644 --- a/test/e2e/kubectl.go +++ b/test/e2e/kubectl.go @@ -529,7 +529,7 @@ var _ = Describe("Kubectl client", func() { checkOutput(output, requiredStrings) // Node - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred()) node := nodes.Items[0] output = runKubectlOrDie("describe", "node", node.Name) @@ -1088,7 +1088,7 @@ func forEachReplicationController(c *client.Client, ns, selectorKey, selectorVal var err error for t := time.Now(); time.Since(t) < podListTimeout; time.Sleep(poll) { label := labels.SelectorFromSet(labels.Set(map[string]string{selectorKey: selectorValue})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} rcs, err = c.ReplicationControllers(ns).List(options) Expect(err).NotTo(HaveOccurred()) if len(rcs.Items) > 0 { diff --git a/test/e2e/kubelet.go b/test/e2e/kubelet.go index 594e797c350..a03ee0822f9 100644 --- a/test/e2e/kubelet.go +++ b/test/e2e/kubelet.go @@ -21,7 +21,7 @@ import ( "strings" "time" - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" @@ -94,7 +94,7 @@ var _ = Describe("kubelet", func() { var resourceMonitor *resourceMonitor BeforeEach(func() { - nodes, err := framework.Client.Nodes().List(unversioned.ListOptions{}) + nodes, err := framework.Client.Nodes().List(api.ListOptions{}) expectNoError(err) numNodes = len(nodes.Items) nodeNames = sets.NewString() diff --git a/test/e2e/kubelet_perf.go b/test/e2e/kubelet_perf.go index 19c2cb12011..61cd3bd6b76 100644 --- a/test/e2e/kubelet_perf.go +++ b/test/e2e/kubelet_perf.go @@ -21,7 +21,7 @@ import ( "strings" "time" - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" @@ -144,7 +144,7 @@ var _ = Describe("Kubelet", func() { var rm *resourceMonitor BeforeEach(func() { - nodes, err := framework.Client.Nodes().List(unversioned.ListOptions{}) + nodes, err := framework.Client.Nodes().List(api.ListOptions{}) expectNoError(err) nodeNames = sets.NewString() for _, node := range nodes.Items { diff --git a/test/e2e/kubelet_stats.go b/test/e2e/kubelet_stats.go index e1f6f646fd3..847624ceb03 100644 --- a/test/e2e/kubelet_stats.go +++ b/test/e2e/kubelet_stats.go @@ -33,7 +33,6 @@ import ( cadvisorapi "github.com/google/cadvisor/info/v1" "github.com/prometheus/common/model" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/kubelet" "k8s.io/kubernetes/pkg/kubelet/metrics" @@ -271,11 +270,11 @@ func getOneTimeResourceUsageOnNode( } func getKubeSystemContainersResourceUsage(c *client.Client) (resourceUsagePerContainer, error) { - pods, err := c.Pods("kube-system").List(unversioned.ListOptions{}) + pods, err := c.Pods("kube-system").List(api.ListOptions{}) if err != nil { return resourceUsagePerContainer{}, err } - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) if err != nil { return resourceUsagePerContainer{}, err } @@ -686,7 +685,7 @@ func newResourceMonitor(c *client.Client, containerNames []string, pollingInterv } func (r *resourceMonitor) Start() { - nodes, err := r.client.Nodes().List(unversioned.ListOptions{}) + nodes, err := r.client.Nodes().List(api.ListOptions{}) if err != nil { Failf("resourceMonitor: unable to get list of nodes: %v", err) } diff --git a/test/e2e/kubeproxy.go b/test/e2e/kubeproxy.go index 7bae392c980..7f34e6a2778 100644 --- a/test/e2e/kubeproxy.go +++ b/test/e2e/kubeproxy.go @@ -429,7 +429,7 @@ func (config *KubeProxyTestConfig) setup() { } By("Getting node addresses") - nodeList, err := config.f.Client.Nodes().List(unversioned.ListOptions{}) + nodeList, err := config.f.Client.Nodes().List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred(), fmt.Sprintf("Failed to get node list: %v", err)) config.externalAddrs = NodeAddresses(nodeList, api.NodeExternalIP) if len(config.externalAddrs) < 2 { @@ -457,7 +457,7 @@ func (config *KubeProxyTestConfig) setup() { func (config *KubeProxyTestConfig) cleanup() { nsClient := config.getNamespacesClient() - nsList, err := nsClient.List(unversioned.ListOptions{}) + nsList, err := nsClient.List(api.ListOptions{}) if err == nil { for _, ns := range nsList.Items { if strings.Contains(ns.Name, config.f.BaseName) && ns.Name != config.f.Namespace.Name { @@ -468,7 +468,7 @@ func (config *KubeProxyTestConfig) cleanup() { } func (config *KubeProxyTestConfig) createNetProxyPods(podName string, selector map[string]string) []*api.Pod { - nodes, err := config.f.Client.Nodes().List(unversioned.ListOptions{}) + nodes, err := config.f.Client.Nodes().List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred()) // create pods, one for each node diff --git a/test/e2e/latency.go b/test/e2e/latency.go index 69e6ab42b22..4971ebde545 100644 --- a/test/e2e/latency.go +++ b/test/e2e/latency.go @@ -69,7 +69,7 @@ var _ = Describe("Latency [Skipped]", func() { ns = framework.Namespace.Name var err error - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) expectNoError(err) nodeCount = len(nodes.Items) Expect(nodeCount).NotTo(BeZero()) @@ -143,13 +143,12 @@ func runLatencyTest(nodeCount int, c *client.Client, ns string) { stopCh := make(chan struct{}) _, informer := framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - selector := labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) - options.LabelSelector.Selector = selector + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.LabelSelector = labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) return c.Pods(ns).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.LabelSelector.Selector = labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.LabelSelector = labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}) return c.Pods(ns).Watch(options) }, }, @@ -197,7 +196,7 @@ func runLatencyTest(nodeCount int, c *client.Client, ns string) { "involvedObject.namespace": ns, "source": "scheduler", }.AsSelector() - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} schedEvents, err := c.Events(ns).List(options) expectNoError(err) for k := range createTimestamps { diff --git a/test/e2e/load.go b/test/e2e/load.go index 14a0164e4df..c53b5df1e0b 100644 --- a/test/e2e/load.go +++ b/test/e2e/load.go @@ -23,7 +23,7 @@ import ( "sync" "time" - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" @@ -72,7 +72,7 @@ var _ = Describe("Load capacity [Skipped]", func() { BeforeEach(func() { c = framework.Client ns = framework.Namespace.Name - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) expectNoError(err) nodeCount = len(nodes.Items) Expect(nodeCount).NotTo(BeZero()) @@ -214,8 +214,8 @@ func scaleRC(wg *sync.WaitGroup, config *RCConfig) { expectNoError(ScaleRC(config.Client, config.Namespace, config.Name, newSize, true), fmt.Sprintf("scaling rc %s for the first time", config.Name)) selector := labels.SelectorFromSet(labels.Set(map[string]string{"name": config.Name})) - options := unversioned.ListOptions{ - LabelSelector: unversioned.LabelSelector{selector}, + options := api.ListOptions{ + LabelSelector: selector, ResourceVersion: "0", } _, err := config.Client.Pods(config.Namespace).List(options) diff --git a/test/e2e/mesos.go b/test/e2e/mesos.go index 1863de36b25..d8dd94d2c1b 100644 --- a/test/e2e/mesos.go +++ b/test/e2e/mesos.go @@ -44,7 +44,7 @@ var _ = Describe("Mesos", func() { nodeClient := framework.Client.Nodes() rackA := labels.SelectorFromSet(map[string]string{"k8s.mesosphere.io/attribute-rack": "1"}) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{rackA}} + options := api.ListOptions{LabelSelector: rackA} nodes, err := nodeClient.List(options) if err != nil { Failf("Failed to query for node: %v", err) @@ -64,7 +64,7 @@ var _ = Describe("Mesos", func() { client := framework.Client expectNoError(allNodesReady(client, util.ForeverTestTimeout), "all nodes ready") - nodelist, err := client.Nodes().List(unversioned.ListOptions{}) + nodelist, err := client.Nodes().List(api.ListOptions{}) expectNoError(err, "nodes fetched from apiserver") const ns = "static-pods" @@ -109,7 +109,7 @@ var _ = Describe("Mesos", func() { role1 := labels.SelectorFromSet(map[string]string{ "k8s.mesosphere.io/attribute-role": "role1", }) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{role1}} + options := api.ListOptions{LabelSelector: role1} nodes, err := nodeClient.List(options) expectNoError(err) diff --git a/test/e2e/metrics_util.go b/test/e2e/metrics_util.go index d35c501f329..ca01d4be6c2 100644 --- a/test/e2e/metrics_util.go +++ b/test/e2e/metrics_util.go @@ -29,7 +29,7 @@ import ( "strings" "time" - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/util/sets" @@ -178,7 +178,7 @@ func listPodsLatencyThreshold(numNodes int) time.Duration { // Prints top five summary metrics for request types with latency and returns // number of such request types above threshold. func HighLatencyRequests(c *client.Client) (int, error) { - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) if err != nil { return 0, err } diff --git a/test/e2e/monitor_resources.go b/test/e2e/monitor_resources.go index b8bcb523ed7..8031c26e68b 100644 --- a/test/e2e/monitor_resources.go +++ b/test/e2e/monitor_resources.go @@ -19,7 +19,7 @@ package e2e import ( "time" - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" . "github.com/onsi/ginkgo" @@ -82,7 +82,7 @@ var _ = Describe("Resource usage of system containers", func() { It("should not exceed expected amount.", func() { By("Getting ResourceConsumption on all nodes") - nodeList, err := c.Nodes().List(unversioned.ListOptions{}) + nodeList, err := c.Nodes().List(api.ListOptions{}) expectNoError(err) resourceUsagePerNode := make(map[string][]resourceUsagePerContainer) diff --git a/test/e2e/monitoring.go b/test/e2e/monitoring.go index 5a22369904e..8c7d96bc296 100644 --- a/test/e2e/monitoring.go +++ b/test/e2e/monitoring.go @@ -23,7 +23,6 @@ import ( influxdb "github.com/influxdb/influxdb/client" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" @@ -78,7 +77,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error // is running (which would be an error except during a rolling update). for _, rcLabel := range rcLabels { selector := labels.Set{"k8s-app": rcLabel}.AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} rcList, err := c.ReplicationControllers(api.NamespaceSystem).List(options) if err != nil { return nil, err @@ -89,7 +88,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error } for _, rc := range rcList.Items { selector := labels.Set(rc.Spec.Selector).AsSelector() - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} podList, err := c.Pods(api.NamespaceSystem).List(options) if err != nil { return nil, err @@ -106,7 +105,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error } func expectedServicesExist(c *client.Client) error { - serviceList, err := c.Services(api.NamespaceSystem).List(unversioned.ListOptions{}) + serviceList, err := c.Services(api.NamespaceSystem).List(api.ListOptions{}) if err != nil { return err } @@ -124,7 +123,7 @@ func expectedServicesExist(c *client.Client) error { } func getAllNodesInCluster(c *client.Client) ([]string, error) { - nodeList, err := c.Nodes().List(unversioned.ListOptions{}) + nodeList, err := c.Nodes().List(api.ListOptions{}) if err != nil { return nil, err } @@ -244,7 +243,7 @@ func testMonitoringUsingHeapsterInfluxdb(c *client.Client) { func printDebugInfo(c *client.Client) { set := labels.Set{"k8s-app": "heapster"} - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{set.AsSelector()}} + options := api.ListOptions{LabelSelector: set.AsSelector()} podList, err := c.Pods(api.NamespaceSystem).List(options) if err != nil { Logf("Error while listing pods %v", err) diff --git a/test/e2e/namespace.go b/test/e2e/namespace.go index 9aa47b87b46..7775e1b227a 100644 --- a/test/e2e/namespace.go +++ b/test/e2e/namespace.go @@ -22,7 +22,7 @@ import ( "sync" "time" - "k8s.io/kubernetes/pkg/api/unversioned" + "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/util/wait" @@ -58,7 +58,7 @@ func extinguish(c *client.Client, totalNS int, maxAllowedAfterDel int, maxSecond expectNoError(wait.Poll(2*time.Second, time.Duration(maxSeconds)*time.Second, func() (bool, error) { var cnt = 0 - nsList, err := c.Namespaces().List(unversioned.ListOptions{}) + nsList, err := c.Namespaces().List(api.ListOptions{}) if err != nil { return false, err } diff --git a/test/e2e/networking.go b/test/e2e/networking.go index 649e605ace5..ab0353a0b89 100644 --- a/test/e2e/networking.go +++ b/test/e2e/networking.go @@ -136,7 +136,7 @@ var _ = Describe("Networking", func() { By("Creating a webserver (pending) pod on each node") - nodes, err := f.Client.Nodes().List(unversioned.ListOptions{}) + nodes, err := f.Client.Nodes().List(api.ListOptions{}) if err != nil { Failf("Failed to list nodes: %v", err) } diff --git a/test/e2e/nodeoutofdisk.go b/test/e2e/nodeoutofdisk.go index cda3adba620..c690f16890f 100644 --- a/test/e2e/nodeoutofdisk.go +++ b/test/e2e/nodeoutofdisk.go @@ -24,7 +24,6 @@ import ( cadvisorapi "github.com/google/cadvisor/info/v1" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/fields" "k8s.io/kubernetes/pkg/labels" @@ -140,7 +139,7 @@ var _ = Describe("NodeOutOfDisk", func() { "source": "scheduler", "reason": "FailedScheduling", }.AsSelector() - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} schedEvents, err := c.Events(ns).List(options) expectNoError(err) @@ -203,7 +202,7 @@ func availCpu(c *client.Client, node *api.Node) (int64, error) { podClient := c.Pods(api.NamespaceAll) selector := fields.Set{"spec.nodeName": node.Name}.AsSelector() - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} pods, err := podClient.List(options) if err != nil { return 0, fmt.Errorf("failed to retrieve all the pods on node %s: %v", node.Name, err) diff --git a/test/e2e/pd.go b/test/e2e/pd.go index fc928ed0859..d9c1a1f01ba 100644 --- a/test/e2e/pd.go +++ b/test/e2e/pd.go @@ -53,7 +53,7 @@ var _ = Describe("Pod Disks", func() { podClient = framework.Client.Pods(framework.Namespace.Name) - nodes, err := framework.Client.Nodes().List(unversioned.ListOptions{}) + nodes, err := framework.Client.Nodes().List(api.ListOptions{}) expectNoError(err, "Failed to list nodes for e2e cluster.") Expect(len(nodes.Items)).To(BeNumerically(">=", 2), "Requires at least 2 nodes") diff --git a/test/e2e/pods.go b/test/e2e/pods.go index 66f84d4ea23..7a3632a3b55 100644 --- a/test/e2e/pods.go +++ b/test/e2e/pods.go @@ -30,7 +30,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/resource" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/kubelet" "k8s.io/kubernetes/pkg/labels" @@ -300,14 +299,14 @@ var _ = Describe("Pods", func() { By("setting up watch") selector := labels.SelectorFromSet(labels.Set(map[string]string{"time": value})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} pods, err := podClient.List(options) if err != nil { Failf("Failed to query for pods: %v", err) } Expect(len(pods.Items)).To(Equal(0)) - options = unversioned.ListOptions{ - LabelSelector: unversioned.LabelSelector{selector}, + options = api.ListOptions{ + LabelSelector: selector, ResourceVersion: pods.ListMeta.ResourceVersion, } w, err := podClient.Watch(options) @@ -327,7 +326,7 @@ var _ = Describe("Pods", func() { By("verifying the pod is in kubernetes") selector = labels.SelectorFromSet(labels.Set(map[string]string{"time": value})) - options = unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options = api.ListOptions{LabelSelector: selector} pods, err = podClient.List(options) if err != nil { Failf("Failed to query for pods: %v", err) @@ -373,7 +372,7 @@ var _ = Describe("Pods", func() { Expect(lastPod.Spec.TerminationGracePeriodSeconds).ToNot(BeZero()) selector = labels.SelectorFromSet(labels.Set(map[string]string{"time": value})) - options = unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options = api.ListOptions{LabelSelector: selector} pods, err = podClient.List(options) if err != nil { Fail(fmt.Sprintf("Failed to list pods to verify deletion: %v", err)) @@ -429,7 +428,7 @@ var _ = Describe("Pods", func() { By("verifying the pod is in kubernetes") selector := labels.SelectorFromSet(labels.Set(map[string]string{"time": value})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} pods, err := podClient.List(options) Expect(len(pods.Items)).To(Equal(1)) @@ -461,7 +460,7 @@ var _ = Describe("Pods", func() { By("verifying the updated pod is in kubernetes") selector = labels.SelectorFromSet(labels.Set(map[string]string{"time": value})) - options = unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options = api.ListOptions{LabelSelector: selector} pods, err = podClient.List(options) Expect(len(pods.Items)).To(Equal(1)) Logf("Pod update OK") @@ -1049,7 +1048,7 @@ var _ = Describe("Pods", func() { By("verifying the pod is in kubernetes") selector := labels.SelectorFromSet(labels.Set(map[string]string{"time": value})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} pods, err := podClient.List(options) if err != nil { Failf("Failed to query for pods: %v", err) @@ -1124,7 +1123,7 @@ var _ = Describe("Pods", func() { By("verifying the pod is in kubernetes") selector := labels.SelectorFromSet(labels.Set(map[string]string{"time": value})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} pods, err := podClient.List(options) if err != nil { Failf("Failed to query for pods: %v", err) diff --git a/test/e2e/proxy.go b/test/e2e/proxy.go index 21520b3209a..8c7e76db42b 100644 --- a/test/e2e/proxy.go +++ b/test/e2e/proxy.go @@ -26,7 +26,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/intstr" @@ -251,7 +250,7 @@ func truncate(b []byte, maxLen int) []byte { } func pickNode(c *client.Client) (string, error) { - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) if err != nil { return "", err } diff --git a/test/e2e/reboot.go b/test/e2e/reboot.go index 56b5be880e2..6a856ead8fc 100644 --- a/test/e2e/reboot.go +++ b/test/e2e/reboot.go @@ -22,7 +22,6 @@ 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" "k8s.io/kubernetes/pkg/labels" @@ -62,7 +61,7 @@ var _ = Describe("Reboot", func() { // events for the kube-system namespace on failures namespaceName := api.NamespaceSystem By(fmt.Sprintf("Collecting events from namespace %q.", namespaceName)) - events, err := f.Client.Events(namespaceName).List(unversioned.ListOptions{}) + events, err := f.Client.Events(namespaceName).List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred()) for _, e := range events.Items { diff --git a/test/e2e/resize_nodes.go b/test/e2e/resize_nodes.go index d889a834ca5..231ef6c5d6b 100644 --- a/test/e2e/resize_nodes.go +++ b/test/e2e/resize_nodes.go @@ -233,7 +233,7 @@ func podsCreated(c *client.Client, ns, name string, replicas int) (*api.PodList, // List the pods, making sure we observe all the replicas. label := labels.SelectorFromSet(labels.Set(map[string]string{"name": name})) for start := time.Now(); time.Since(start) < timeout; time.Sleep(5 * time.Second) { - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err := c.Pods(ns).List(options) if err != nil { return nil, err @@ -397,7 +397,7 @@ var _ = Describe("Nodes", func() { BeforeEach(func() { c = framework.Client ns = framework.Namespace.Name - systemPods, err := c.Pods(api.NamespaceSystem).List(unversioned.ListOptions{}) + systemPods, err := c.Pods(api.NamespaceSystem).List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred()) systemPodsNo = len(systemPods.Items) }) @@ -511,7 +511,7 @@ var _ = Describe("Nodes", func() { By("choose a node with at least one pod - we will block some network traffic on this node") label := labels.SelectorFromSet(labels.Set(map[string]string{"name": name})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err := c.Pods(ns).List(options) // list pods after all have been scheduled Expect(err).NotTo(HaveOccurred()) nodeName := pods.Items[0].Spec.NodeName diff --git a/test/e2e/scheduler_predicates.go b/test/e2e/scheduler_predicates.go index 56ec26fb426..dbf9d3f9e75 100644 --- a/test/e2e/scheduler_predicates.go +++ b/test/e2e/scheduler_predicates.go @@ -46,7 +46,7 @@ func getPodsScheduled(pods *api.PodList) (scheduledPods, notScheduledPods []api. // Simplified version of RunRC, that does not create RC, but creates plain Pods and // requires passing whole Pod definition, which is needed to test various Scheduler predicates. func startPods(c *client.Client, replicas int, ns string, podNamePrefix string, pod api.Pod) { - allPods, err := c.Pods(api.NamespaceAll).List(unversioned.ListOptions{}) + allPods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{}) expectNoError(err) podsScheduledBefore, _ := getPodsScheduled(allPods) @@ -67,7 +67,7 @@ func startPods(c *client.Client, replicas int, ns string, podNamePrefix string, startTime := time.Now() currentlyScheduledPods := 0 for len(podsScheduledBefore)+replicas != currentlyScheduledPods { - allPods, err := c.Pods(api.NamespaceAll).List(unversioned.ListOptions{}) + allPods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{}) expectNoError(err) scheduledPods := 0 for _, pod := range allPods.Items { @@ -95,7 +95,7 @@ func getRequestedCPU(pod api.Pod) int64 { } func verifyResult(c *client.Client, podName string, ns string) { - allPods, err := c.Pods(api.NamespaceAll).List(unversioned.ListOptions{}) + allPods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{}) expectNoError(err) scheduledPods, notScheduledPods := getPodsScheduled(allPods) @@ -106,7 +106,7 @@ func verifyResult(c *client.Client, podName string, ns string) { "source": "scheduler", "reason": "FailedScheduling", }.AsSelector() - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} schedEvents, err := c.Events(ns).List(options) expectNoError(err) // If we failed to find event with a capitalized first letter of reason @@ -121,7 +121,7 @@ func verifyResult(c *client.Client, podName string, ns string) { "source": "scheduler", "reason": "failedScheduling", }.AsSelector() - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} schedEvents, err = c.Events(ns).List(options) expectNoError(err) } @@ -142,7 +142,7 @@ func verifyResult(c *client.Client, podName string, ns string) { func cleanupPods(c *client.Client, ns string) { By("Removing all pods in namespace " + ns) - pods, err := c.Pods(ns).List(unversioned.ListOptions{}) + pods, err := c.Pods(ns).List(api.ListOptions{}) expectNoError(err) opt := api.NewDeleteOptions(0) for _, p := range pods.Items { @@ -155,13 +155,13 @@ func waitForStableCluster(c *client.Client) int { timeout := 10 * time.Minute startTime := time.Now() - allPods, err := c.Pods(api.NamespaceAll).List(unversioned.ListOptions{}) + allPods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{}) expectNoError(err) scheduledPods, currentlyNotScheduledPods := getPodsScheduled(allPods) for len(currentlyNotScheduledPods) != 0 { time.Sleep(2 * time.Second) - allPods, err := c.Pods(api.NamespaceAll).List(unversioned.ListOptions{}) + allPods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{}) expectNoError(err) scheduledPods, currentlyNotScheduledPods = getPodsScheduled(allPods) @@ -195,7 +195,7 @@ var _ = Describe("SchedulerPredicates", func() { c = framework.Client ns = framework.Namespace.Name var err error - nodeList, err = c.Nodes().List(unversioned.ListOptions{}) + nodeList, err = c.Nodes().List(api.ListOptions{}) expectNoError(err) }) @@ -275,7 +275,7 @@ var _ = Describe("SchedulerPredicates", func() { } waitForStableCluster(c) - pods, err := c.Pods(api.NamespaceAll).List(unversioned.ListOptions{}) + pods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{}) expectNoError(err) for _, pod := range pods.Items { _, found := nodeToCapacityMap[pod.Spec.NodeName] diff --git a/test/e2e/service.go b/test/e2e/service.go index 65ce1ab6b2c..48840fdedba 100644 --- a/test/e2e/service.go +++ b/test/e2e/service.go @@ -30,7 +30,6 @@ import ( . "github.com/onsi/gomega" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/types" "k8s.io/kubernetes/pkg/util" @@ -1051,7 +1050,7 @@ func validateEndpointsOrFail(c *client.Client, namespace, serviceName string, ex i++ } - if pods, err := c.Pods(api.NamespaceAll).List(unversioned.ListOptions{}); err == nil { + if pods, err := c.Pods(api.NamespaceAll).List(api.ListOptions{}); err == nil { for _, pod := range pods.Items { Logf("Pod %s\t%s\t%s\t%s", pod.Namespace, pod.Name, pod.Spec.NodeName, pod.DeletionTimestamp) } @@ -1103,7 +1102,7 @@ func collectAddresses(nodes *api.NodeList, addressType api.NodeAddressType) []st } func getNodePublicIps(c *client.Client) ([]string, error) { - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) if err != nil { return nil, err } diff --git a/test/e2e/service_accounts.go b/test/e2e/service_accounts.go index d399d27e2db..0169e546440 100644 --- a/test/e2e/service_accounts.go +++ b/test/e2e/service_accounts.go @@ -21,7 +21,6 @@ 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" "k8s.io/kubernetes/pkg/util" @@ -42,7 +41,7 @@ var _ = Describe("ServiceAccounts", func() { expectNoError(wait.Poll(time.Millisecond*500, time.Second*10, func() (bool, error) { By("getting the auto-created API token") tokenSelector := fields.SelectorFromSet(map[string]string{client.SecretType: string(api.SecretTypeServiceAccountToken)}) - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{tokenSelector}} + options := api.ListOptions{FieldSelector: tokenSelector} secrets, err := f.Client.Secrets(f.Namespace.Name).List(options) if err != nil { return false, err diff --git a/test/e2e/service_latency.go b/test/e2e/service_latency.go index 500f773dcc9..2f10065ece9 100644 --- a/test/e2e/service_latency.go +++ b/test/e2e/service_latency.go @@ -23,7 +23,6 @@ import ( "time" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/controller/framework" "k8s.io/kubernetes/pkg/runtime" @@ -277,10 +276,10 @@ func (eq *endpointQueries) added(e *api.Endpoints) { func startEndpointWatcher(f *Framework, q *endpointQueries) { _, controller := framework.NewInformer( &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { + ListFunc: func(options api.ListOptions) (runtime.Object, error) { return f.Client.Endpoints(f.Namespace.Name).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { return f.Client.Endpoints(f.Namespace.Name).Watch(options) }, }, diff --git a/test/e2e/serviceloadbalancers.go b/test/e2e/serviceloadbalancers.go index 290897a7897..5a5938c44be 100644 --- a/test/e2e/serviceloadbalancers.go +++ b/test/e2e/serviceloadbalancers.go @@ -23,7 +23,6 @@ import ( "path/filepath" "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/util/wait" @@ -111,7 +110,7 @@ func (h *haproxyControllerTester) start(namespace string) (err error) { // Find the pods of the rc we just created. labelSelector := labels.SelectorFromSet( labels.Set(map[string]string{"name": h.rcName})) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}} + options := api.ListOptions{LabelSelector: labelSelector} pods, err := h.client.Pods(h.rcNamespace).List(options) if err != nil { return err diff --git a/test/e2e/util.go b/test/e2e/util.go index e27ebdb1a08..6e431d517ba 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -161,14 +161,14 @@ type podStore struct { func newPodStore(c *client.Client, namespace string, label labels.Selector, field fields.Selector) *podStore { lw := &cache.ListWatch{ - ListFunc: func(options unversioned.ListOptions) (runtime.Object, error) { - options.LabelSelector.Selector = label - options.FieldSelector.Selector = field + ListFunc: func(options api.ListOptions) (runtime.Object, error) { + options.LabelSelector = label + options.FieldSelector = field return c.Pods(namespace).List(options) }, - WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) { - options.LabelSelector.Selector = label - options.FieldSelector.Selector = field + WatchFunc: func(options api.ListOptions) (watch.Interface, error) { + options.LabelSelector = label + options.FieldSelector = field return c.Pods(namespace).Watch(options) }, } @@ -368,7 +368,7 @@ func waitForPodsRunningReady(ns string, minPods int, timeout time.Duration) erro // We get the new list of pods and replication controllers in every // iteration because more pods come online during startup and we want to // ensure they are also checked. - rcList, err := c.ReplicationControllers(ns).List(unversioned.ListOptions{}) + rcList, err := c.ReplicationControllers(ns).List(api.ListOptions{}) if err != nil { Logf("Error getting replication controllers in namespace '%s': %v", ns, err) return false, nil @@ -378,7 +378,7 @@ func waitForPodsRunningReady(ns string, minPods int, timeout time.Duration) erro replicas += rc.Spec.Replicas } - podList, err := c.Pods(ns).List(unversioned.ListOptions{}) + podList, err := c.Pods(ns).List(api.ListOptions{}) if err != nil { Logf("Error getting pods in namespace '%s': %v", ns, err) return false, nil @@ -422,7 +422,7 @@ func waitForPodsRunningReady(ns string, minPods int, timeout time.Duration) erro // Returns the list of deleted namespaces or an error. func deleteNamespaces(c *client.Client, deleteFilter, skipFilter []string) ([]string, error) { By("Deleting namespaces") - nsList, err := c.Namespaces().List(unversioned.ListOptions{}) + nsList, err := c.Namespaces().List(api.ListOptions{}) Expect(err).NotTo(HaveOccurred()) var deleted []string var wg sync.WaitGroup @@ -469,7 +469,7 @@ func waitForNamespacesDeleted(c *client.Client, namespaces []string, timeout tim //Now POLL until all namespaces have been eradicated. return wait.Poll(2*time.Second, timeout, func() (bool, error) { - nsList, err := c.Namespaces().List(unversioned.ListOptions{}) + nsList, err := c.Namespaces().List(api.ListOptions{}) if err != nil { return false, err } @@ -601,7 +601,7 @@ func checkTestingNSDeletedExcept(c *client.Client, skip string) error { Logf("Waiting for terminating namespaces to be deleted...") for start := time.Now(); time.Since(start) < timeout; time.Sleep(15 * time.Second) { - namespaces, err := c.Namespaces().List(unversioned.ListOptions{}) + namespaces, err := c.Namespaces().List(api.ListOptions{}) if err != nil { Logf("Listing namespaces failed: %v", err) continue @@ -643,7 +643,7 @@ func deleteNS(c *client.Client, namespace string, timeout time.Duration) error { // check for pods that were not deleted remaining := []string{} missingTimestamp := false - if pods, perr := c.Pods(namespace).List(unversioned.ListOptions{}); perr == nil { + if pods, perr := c.Pods(namespace).List(api.ListOptions{}); perr == nil { for _, pod := range pods.Items { Logf("Pod %s %s on node %s remains, has deletion timestamp %s", namespace, pod.Name, pod.Spec.NodeName, pod.DeletionTimestamp) remaining = append(remaining, pod.Name) @@ -731,7 +731,7 @@ func waitForRCPodOnNode(c *client.Client, ns, rcName, node string) (*api.Pod, er var p *api.Pod = nil err := wait.PollImmediate(10*time.Second, 5*time.Minute, func() (bool, error) { Logf("Waiting for pod %s to appear on node %s", rcName, node) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err := c.Pods(ns).List(options) if err != nil { return false, err @@ -751,7 +751,7 @@ func waitForRCPodOnNode(c *client.Client, ns, rcName, node string) (*api.Pod, er func waitForPodToDisappear(c *client.Client, ns, podName string, label labels.Selector, interval, timeout time.Duration) error { return wait.PollImmediate(interval, timeout, func() (bool, error) { Logf("Waiting for pod %s to disappear", podName) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err := c.Pods(ns).List(options) if err != nil { return false, err @@ -814,7 +814,7 @@ func waitForService(c *client.Client, namespace, name string, exist bool, interv func waitForServiceEndpointsNum(c *client.Client, namespace, serviceName string, expectNum int, interval, timeout time.Duration) error { return wait.Poll(interval, timeout, func() (bool, error) { Logf("Waiting for amount of service:%s endpoints to %d", serviceName, expectNum) - list, err := c.Endpoints(namespace).List(unversioned.ListOptions{}) + list, err := c.Endpoints(namespace).List(api.ListOptions{}) if err != nil { return false, err } @@ -882,7 +882,7 @@ type podResponseChecker struct { // checkAllResponses issues GETs to all pods in the context and verify they reply with pod name. func (r podResponseChecker) checkAllResponses() (done bool, err error) { successes := 0 - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{r.label}} + options := api.ListOptions{LabelSelector: r.label} currentPods, err := r.c.Pods(r.ns).List(options) Expect(err).NotTo(HaveOccurred()) for i, pod := range r.pods.Items { @@ -1623,7 +1623,7 @@ func (config *RCConfig) start() error { if oldRunning != config.Replicas { // List only pods from a given replication controller. - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} if pods, err := config.Client.Pods(api.NamespaceAll).List(options); err == nil { for _, pod := range pods.Items { @@ -1653,7 +1653,7 @@ func dumpPodDebugInfo(c *client.Client, pods []*api.Pod) { } func dumpAllPodInfo(c *client.Client) { - pods, err := c.Pods("").List(unversioned.ListOptions{}) + pods, err := c.Pods("").List(api.ListOptions{}) if err != nil { Logf("unable to fetch pod debug info: %v", err) } @@ -1661,7 +1661,7 @@ func dumpAllPodInfo(c *client.Client) { } func dumpAllNodeInfo(c *client.Client) { - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) if err != nil { Logf("unable to fetch node list: %v", err) return @@ -1715,7 +1715,7 @@ func getNodeEvents(c *client.Client, nodeName string) []api.Event { "involvedObject.namespace": api.NamespaceAll, "source": "kubelet", }.AsSelector() - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}} + options := api.ListOptions{FieldSelector: selector} events, err := c.Events(api.NamespaceSystem).List(options) if err != nil { Logf("Unexpected error retrieving node events %v", err) @@ -1781,7 +1781,7 @@ waitLoop: // Wait up to 10 minutes for getting pods with certain label func waitForPodsWithLabel(c *client.Client, ns string, label labels.Selector) (pods *api.PodList, err error) { for t := time.Now(); time.Since(t) < podListTimeout; time.Sleep(poll) { - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}} + options := api.ListOptions{LabelSelector: label} pods, err = c.Pods(ns).List(options) Expect(err).NotTo(HaveOccurred()) if len(pods.Items) > 0 { @@ -1834,7 +1834,7 @@ func DeleteRC(c *client.Client, ns, name string) error { func waitForRCPodsGone(c *client.Client, rc *api.ReplicationController) error { return wait.PollImmediate(poll, 2*time.Minute, func() (bool, error) { selector := labels.SelectorFromSet(rc.Spec.Selector) - options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}} + options := api.ListOptions{LabelSelector: selector} if pods, err := c.Pods(rc.Namespace).List(options); err == nil && len(pods.Items) == 0 { return true, nil } @@ -1915,9 +1915,9 @@ func listNodes(c *client.Client, label labels.Selector, field fields.Selector) ( var nodes *api.NodeList var errLast error if wait.PollImmediate(poll, singleCallTimeout, func() (bool, error) { - options := unversioned.ListOptions{ - LabelSelector: unversioned.LabelSelector{label}, - FieldSelector: unversioned.FieldSelector{field}, + options := api.ListOptions{ + LabelSelector: label, + FieldSelector: field, } nodes, errLast = c.Nodes().List(options) return errLast == nil, nil @@ -2008,7 +2008,7 @@ func NodeAddresses(nodelist *api.NodeList, addrType api.NodeAddressType) []strin // if it can't find an external IP for every node, though it still returns all // hosts that it found in that case. func NodeSSHHosts(c *client.Client) ([]string, error) { - nodelist, err := c.Nodes().List(unversioned.ListOptions{}) + nodelist, err := c.Nodes().List(api.ListOptions{}) if err != nil { return nil, fmt.Errorf("error getting nodes: %v", err) } @@ -2256,7 +2256,7 @@ func allNodesReady(c *client.Client, timeout time.Duration) error { var notReady []api.Node err := wait.PollImmediate(poll, timeout, func() (bool, error) { notReady = nil - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) if err != nil { return false, err } @@ -2375,7 +2375,7 @@ func waitForApiserverUp(c *client.Client) error { // waitForClusterSize waits until the cluster has desired size and there is no not-ready nodes in it. func waitForClusterSize(c *client.Client, size int, timeout time.Duration) error { for start := time.Now(); time.Since(start) < timeout; time.Sleep(20 * time.Second) { - nodes, err := c.Nodes().List(unversioned.ListOptions{}) + nodes, err := c.Nodes().List(api.ListOptions{}) if err != nil { Logf("Failed to list nodes: %v", err) continue @@ -2569,7 +2569,7 @@ func getNodePortURL(client *client.Client, ns, name string, svcPort int) (string if err != nil { return "", err } - nodes, err := client.Nodes().List(unversioned.ListOptions{}) + nodes, err := client.Nodes().List(api.ListOptions{}) if err != nil { return "", err } diff --git a/test/integration/client_test.go b/test/integration/client_test.go index f25e63a2c6f..8412fa0ad16 100644 --- a/test/integration/client_test.go +++ b/test/integration/client_test.go @@ -29,7 +29,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/labels" "k8s.io/kubernetes/pkg/util" @@ -54,7 +53,7 @@ func TestClient(t *testing.T) { t.Errorf("expected %#v, got %#v", e, a) } - pods, err := client.Pods(ns).List(unversioned.ListOptions{}) + pods, err := client.Pods(ns).List(api.ListOptions{}) if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -92,7 +91,7 @@ func TestClient(t *testing.T) { } // pod is shown, but not scheduled - pods, err = client.Pods(ns).List(unversioned.ListOptions{}) + pods, err = client.Pods(ns).List(api.ListOptions{}) if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -244,8 +243,8 @@ func TestMultiWatch(t *testing.T) { t.Fatalf("Couldn't make %v: %v", name, err) } go func(name, rv string) { - options := unversioned.ListOptions{ - LabelSelector: unversioned.LabelSelector{labels.Set{"watchlabel": name}.AsSelector()}, + options := api.ListOptions{ + LabelSelector: labels.Set{"watchlabel": name}.AsSelector(), ResourceVersion: rv, } w, err := client.Pods(ns).Watch(options) diff --git a/test/integration/framework/master_utils.go b/test/integration/framework/master_utils.go index 815d1728b50..6bbfdd62eec 100644 --- a/test/integration/framework/master_utils.go +++ b/test/integration/framework/master_utils.go @@ -29,7 +29,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/apiserver" "k8s.io/kubernetes/pkg/client/record" client "k8s.io/kubernetes/pkg/client/unversioned" @@ -249,7 +248,7 @@ func StartPods(numPods int, host string, restClient *client.Client) error { glog.Infof("StartPods took %v with numPods %d", time.Since(start), numPods) }() hostField := fields.OneTermEqualSelector(client.PodHost, host) - options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{hostField}} + options := api.ListOptions{FieldSelector: hostField} pods, err := restClient.Pods(TestNS).List(options) if err != nil || len(pods.Items) == numPods { return err diff --git a/test/integration/metrics_test.go b/test/integration/metrics_test.go index fb58485b8c8..eeafbbbdc9a 100644 --- a/test/integration/metrics_test.go +++ b/test/integration/metrics_test.go @@ -27,7 +27,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/test/integration/framework" @@ -109,7 +108,7 @@ func TestApiserverMetrics(t *testing.T) { // Make a request to the apiserver to ensure there's at least one data point // for the metrics we're expecting -- otherwise, they won't be exported. client := client.NewOrDie(&client.Config{Host: s.URL, GroupVersion: testapi.Default.GroupVersion()}) - if _, err := client.Pods(api.NamespaceDefault).List(unversioned.ListOptions{}); err != nil { + if _, err := client.Pods(api.NamespaceDefault).List(api.ListOptions{}); err != nil { t.Fatalf("unexpected error getting pods: %v", err) } diff --git a/test/integration/persistent_volumes_test.go b/test/integration/persistent_volumes_test.go index 2b7daf67fd9..8884bf875c4 100644 --- a/test/integration/persistent_volumes_test.go +++ b/test/integration/persistent_volumes_test.go @@ -27,7 +27,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" fake_cloud "k8s.io/kubernetes/pkg/cloudprovider/providers/fake" persistentvolumecontroller "k8s.io/kubernetes/pkg/controller/persistentvolume" @@ -81,7 +80,7 @@ func TestPersistentVolumeRecycler(t *testing.T) { }, } - w, _ := testClient.PersistentVolumes().Watch(unversioned.ListOptions{}) + w, _ := testClient.PersistentVolumes().Watch(api.ListOptions{}) defer w.Stop() _, _ = testClient.PersistentVolumes().Create(pv) @@ -107,7 +106,7 @@ func TestPersistentVolumeRecycler(t *testing.T) { // change the reclamation policy of the PV for the next test pv.Spec.PersistentVolumeReclaimPolicy = api.PersistentVolumeReclaimDelete - w, _ = testClient.PersistentVolumes().Watch(unversioned.ListOptions{}) + w, _ = testClient.PersistentVolumes().Watch(api.ListOptions{}) defer w.Stop() _, _ = testClient.PersistentVolumes().Create(pv) diff --git a/test/integration/service_account_test.go b/test/integration/service_account_test.go index 9c3aaa9b67e..405ac319c1b 100644 --- a/test/integration/service_account_test.go +++ b/test/integration/service_account_test.go @@ -34,7 +34,6 @@ import ( "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "k8s.io/kubernetes/pkg/api/testapi" - "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/auth/authenticator" "k8s.io/kubernetes/pkg/auth/authenticator/bearertoken" "k8s.io/kubernetes/pkg/auth/authorizer" @@ -171,7 +170,7 @@ func TestServiceAccountTokenAutoCreate(t *testing.T) { tokensToCleanup := sets.NewString(token1Name, token2Name, token3Name) err = wait.Poll(time.Second, 10*time.Second, func() (bool, error) { // Get all secrets in the namespace - secrets, err := c.Secrets(ns).List(unversioned.ListOptions{}) + secrets, err := c.Secrets(ns).List(api.ListOptions{}) // Retrieval errors should fail if err != nil { return false, err @@ -512,11 +511,11 @@ func doServiceAccountAPIRequests(t *testing.T, c *client.Client, ns string, auth readOps := []testOperation{ func() error { - _, err := c.Secrets(ns).List(unversioned.ListOptions{}) + _, err := c.Secrets(ns).List(api.ListOptions{}) return err }, func() error { - _, err := c.Pods(ns).List(unversioned.ListOptions{}) + _, err := c.Pods(ns).List(api.ListOptions{}) return err }, } diff --git a/test/soak/cauldron/cauldron.go b/test/soak/cauldron/cauldron.go index 6a0658e7cb4..8d4c527641c 100644 --- a/test/soak/cauldron/cauldron.go +++ b/test/soak/cauldron/cauldron.go @@ -32,7 +32,6 @@ import ( "github.com/golang/glog" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" - "k8s.io/kubernetes/pkg/api/unversioned" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/util/intstr" ) @@ -67,7 +66,7 @@ func main() { var nodes *api.NodeList for start := time.Now(); time.Since(start) < nodeListTimeout; time.Sleep(2 * time.Second) { - nodes, err = c.Nodes().List(unversioned.ListOptions{}) + nodes, err = c.Nodes().List(api.ListOptions{}) if err == nil { break } diff --git a/test/soak/serve_hostnames/serve_hostnames.go b/test/soak/serve_hostnames/serve_hostnames.go index 60ea3814d0f..57b06661097 100644 --- a/test/soak/serve_hostnames/serve_hostnames.go +++ b/test/soak/serve_hostnames/serve_hostnames.go @@ -87,7 +87,7 @@ func main() { var nodes *api.NodeList for start := time.Now(); time.Since(start) < nodeListTimeout; time.Sleep(2 * time.Second) { - nodes, err = c.Nodes().List(unversioned.ListOptions{}) + nodes, err = c.Nodes().List(api.ListOptions{}) if err == nil { break }