mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #18075 from wojtek-t/only_list_options_in_list
Simplify List() signature in clients.
This commit is contained in:
commit
ffdfc68d11
@ -44,7 +44,6 @@ import (
|
||||
endpointcontroller "k8s.io/kubernetes/pkg/controller/endpoint"
|
||||
nodecontroller "k8s.io/kubernetes/pkg/controller/node"
|
||||
replicationcontroller "k8s.io/kubernetes/pkg/controller/replication"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
|
||||
"k8s.io/kubernetes/pkg/kubelet/cm"
|
||||
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
|
||||
@ -273,7 +272,8 @@ 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) {
|
||||
pods, err := c.Pods(podNamespace).List(labelSelector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}}
|
||||
pods, err := c.Pods(podNamespace).List(options)
|
||||
if err != nil {
|
||||
glog.Infof("Unable to get pods to list: %v", err)
|
||||
return false, nil
|
||||
@ -399,7 +399,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{}); err == nil {
|
||||
if pods, err := c.Pods(namespace).List(unversioned.ListOptions{}); err == nil {
|
||||
for _, pod := range pods.Items {
|
||||
glog.Infof("pod found: %s/%s", namespace, pod.Name)
|
||||
}
|
||||
@ -507,7 +507,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
svcList, err := services.List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
glog.Fatalf("Failed listing services: %v", err)
|
||||
}
|
||||
@ -728,7 +728,7 @@ func runPatchTest(c *client.Client) {
|
||||
|
||||
func runMasterServiceTest(client *client.Client) {
|
||||
time.Sleep(12 * time.Second)
|
||||
svcList, err := client.Services(api.NamespaceDefault).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
svcList, err := client.Services(api.NamespaceDefault).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
glog.Fatalf("Unexpected error listing services: %v", err)
|
||||
}
|
||||
@ -855,7 +855,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
svcList, err := client.Services(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
glog.Fatalf("Failed to list services across namespaces: %v", err)
|
||||
}
|
||||
|
@ -45,10 +45,8 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/errors"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/kubelet/container"
|
||||
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
)
|
||||
|
||||
@ -652,7 +650,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
podList, err := k.client.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return proc.ErrorChanf("failed to reconcile pod registry: %v", err)
|
||||
}
|
||||
@ -728,7 +726,7 @@ func (k *framework) explicitlyReconcileTasks(driver bindings.SchedulerDriver, ta
|
||||
}
|
||||
|
||||
func (ks *framework) recoverTasks() error {
|
||||
podList, err := ks.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
podList, err := ks.client.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
log.V(1).Infof("failed to recover pod registry, madness may ensue: %v", err)
|
||||
return err
|
||||
|
@ -31,7 +31,6 @@ import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
kservice "k8s.io/kubernetes/pkg/controller/endpoint"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
@ -60,7 +59,7 @@ func NewEndpointController(client *client.Client) *endpointController {
|
||||
e.serviceStore.Store, e.serviceController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return e.client.Services(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return e.client.Services(api.NamespaceAll).Watch(options)
|
||||
@ -80,7 +79,7 @@ func NewEndpointController(client *client.Client) *endpointController {
|
||||
e.podStore.Store, e.podController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return e.client.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return e.client.Pods(api.NamespaceAll).Watch(options)
|
||||
@ -386,7 +385,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
list, err := e.client.Endpoints(api.NamespaceAll).List(unversioned.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
|
||||
|
@ -18,8 +18,7 @@ package unversioned
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
)
|
||||
|
||||
type ComponentStatusesInterface interface {
|
||||
@ -28,11 +27,11 @@ type ComponentStatusesInterface interface {
|
||||
|
||||
// ComponentStatusInterface contains methods to retrieve ComponentStatus
|
||||
type ComponentStatusInterface interface {
|
||||
List(label labels.Selector, field fields.Selector) (*api.ComponentStatusList, error)
|
||||
List(opts unversioned.ListOptions) (*api.ComponentStatusList, error)
|
||||
Get(name string) (*api.ComponentStatus, error)
|
||||
|
||||
// TODO: It'd be nice to have watch support at some point
|
||||
//Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
|
||||
//Watch(opts unversioned.ListOptions) (watch.Interface, error)
|
||||
}
|
||||
|
||||
// componentStatuses implements ComponentStatusesInterface
|
||||
@ -44,12 +43,11 @@ func newComponentStatuses(c *Client) *componentStatuses {
|
||||
return &componentStatuses{c}
|
||||
}
|
||||
|
||||
func (c *componentStatuses) List(label labels.Selector, field fields.Selector) (result *api.ComponentStatusList, err error) {
|
||||
func (c *componentStatuses) List(opts unversioned.ListOptions) (result *api.ComponentStatusList, err error) {
|
||||
result = &api.ComponentStatusList{}
|
||||
err = c.client.Get().
|
||||
Resource("componentStatuses").
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
Do().
|
||||
Into(result)
|
||||
|
||||
|
@ -20,8 +20,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -31,7 +29,7 @@ type DaemonSetsNamespacer interface {
|
||||
}
|
||||
|
||||
type DaemonSetInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.DaemonSetList, error)
|
||||
List(opts unversioned.ListOptions) (*extensions.DaemonSetList, error)
|
||||
Get(name string) (*extensions.DaemonSet, error)
|
||||
Create(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error)
|
||||
Update(ctrl *extensions.DaemonSet) (*extensions.DaemonSet, error)
|
||||
@ -53,9 +51,9 @@ func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
|
||||
// Ensure statically that daemonSets implements DaemonSetsInterface.
|
||||
var _ DaemonSetInterface = &daemonSets{}
|
||||
|
||||
func (c *daemonSets) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.DaemonSetList, err error) {
|
||||
func (c *daemonSets) List(opts unversioned.ListOptions) (result *extensions.DaemonSetList, err error) {
|
||||
result = &extensions.DaemonSetList{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("daemonsets").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.r.Get().Namespace(c.ns).Resource("daemonsets").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getDSResourceName() string {
|
||||
@ -57,7 +55,7 @@ func TestListDaemonSets(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
receivedDSs, err := c.Setup(t).Extensions().DaemonSets(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
receivedDSs, err := c.Setup(t).Extensions().DaemonSets(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, receivedDSs, err)
|
||||
|
||||
}
|
||||
|
@ -20,8 +20,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -32,7 +30,7 @@ type DeploymentsNamespacer interface {
|
||||
|
||||
// DeploymentInterface has methods to work with Deployment resources.
|
||||
type DeploymentInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.DeploymentList, error)
|
||||
List(opts unversioned.ListOptions) (*extensions.DeploymentList, error)
|
||||
Get(name string) (*extensions.Deployment, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
Create(*extensions.Deployment) (*extensions.Deployment, error)
|
||||
@ -56,9 +54,9 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.DeploymentList, err error) {
|
||||
func (c *deployments) List(opts unversioned.ListOptions) (result *extensions.DeploymentList, err error) {
|
||||
result = &extensions.DeploymentList{}
|
||||
err = c.client.Get().Namespace(c.ns).Resource("deployments").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.client.Get().Namespace(c.ns).Resource("deployments").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getDeploymentsResoureName() string {
|
||||
@ -100,7 +98,7 @@ func TestDeploymentList(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: deploymentList},
|
||||
}
|
||||
response, err := c.Setup(t).Deployments(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).Deployments(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, response, err)
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,6 @@ import (
|
||||
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -34,7 +32,7 @@ type EndpointsNamespacer interface {
|
||||
// EndpointsInterface has methods to work with Endpoints resources
|
||||
type EndpointsInterface interface {
|
||||
Create(endpoints *api.Endpoints) (*api.Endpoints, error)
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EndpointsList, error)
|
||||
List(opts unversioned.ListOptions) (*api.EndpointsList, error)
|
||||
Get(name string) (*api.Endpoints, error)
|
||||
Delete(name string) error
|
||||
Update(endpoints *api.Endpoints) (*api.Endpoints, error)
|
||||
@ -60,14 +58,12 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.EndpointsList, err error) {
|
||||
func (c *endpoints) List(opts unversioned.ListOptions) (result *api.EndpointsList, err error) {
|
||||
result = &api.EndpointsList{}
|
||||
err = c.r.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("endpoints").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
|
@ -22,8 +22,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func TestListEndpoints(t *testing.T) {
|
||||
@ -44,7 +42,7 @@ func TestListEndpoints(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
receivedEndpointsList, err := c.Setup(t).Endpoints(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
receivedEndpointsList, err := c.Setup(t).Endpoints(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, receivedEndpointsList, err)
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@ import (
|
||||
"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/runtime"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
@ -37,7 +36,7 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EventList, error)
|
||||
List(opts unversioned.ListOptions) (*api.EventList, error)
|
||||
Get(name string) (*api.Event, error)
|
||||
Watch(opts unversioned.ListOptions) (watch.Interface, error)
|
||||
// Search finds events about the specified object
|
||||
@ -117,14 +116,12 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EventList, error) {
|
||||
func (e *events) List(opts unversioned.ListOptions) (*api.EventList, error) {
|
||||
result := &api.EventList{}
|
||||
err := e.client.Get().
|
||||
NamespaceIfScoped(e.namespace, len(e.namespace) > 0).
|
||||
Resource("events").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
Do().
|
||||
Into(result)
|
||||
return result, err
|
||||
@ -174,7 +171,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(labels.Everything(), fieldSelector, unversioned.ListOptions{})
|
||||
return e.List(unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{fieldSelector}})
|
||||
}
|
||||
|
||||
// Delete deletes an existing event.
|
||||
|
@ -24,8 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func TestEventSearch(t *testing.T) {
|
||||
@ -166,8 +164,7 @@ func TestEventList(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: eventList},
|
||||
}
|
||||
response, err := c.Setup(t).Events(ns).List(labels.Everything(),
|
||||
fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).Events(ns).List(unversioned.ListOptions{})
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("%#v should be nil.", err)
|
||||
|
@ -20,8 +20,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -32,7 +30,7 @@ type HorizontalPodAutoscalersNamespacer interface {
|
||||
|
||||
// HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources.
|
||||
type HorizontalPodAutoscalerInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.HorizontalPodAutoscalerList, error)
|
||||
List(opts unversioned.ListOptions) (*extensions.HorizontalPodAutoscalerList, error)
|
||||
Get(name string) (*extensions.HorizontalPodAutoscaler, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
Create(horizontalPodAutoscaler *extensions.HorizontalPodAutoscaler) (*extensions.HorizontalPodAutoscaler, error)
|
||||
@ -56,9 +54,9 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.HorizontalPodAutoscalerList, err error) {
|
||||
func (c *horizontalPodAutoscalers) List(opts unversioned.ListOptions) (result *extensions.HorizontalPodAutoscalerList, err error) {
|
||||
result = &extensions.HorizontalPodAutoscalerList{}
|
||||
err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.client.Get().Namespace(c.ns).Resource("horizontalPodAutoscalers").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getHorizontalPodAutoscalersResoureName() string {
|
||||
@ -100,7 +98,7 @@ func TestHorizontalPodAutoscalerList(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: horizontalPodAutoscalerList},
|
||||
}
|
||||
response, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).Extensions().HorizontalPodAutoscalers(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, response, err)
|
||||
}
|
||||
|
||||
|
@ -20,8 +20,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -32,7 +30,7 @@ type IngressNamespacer interface {
|
||||
|
||||
// IngressInterface exposes methods to work on Ingress resources.
|
||||
type IngressInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.IngressList, error)
|
||||
List(opts unversioned.ListOptions) (*extensions.IngressList, error)
|
||||
Get(name string) (*extensions.Ingress, error)
|
||||
Create(ingress *extensions.Ingress) (*extensions.Ingress, error)
|
||||
Update(ingress *extensions.Ingress) (*extensions.Ingress, error)
|
||||
@ -53,9 +51,9 @@ func newIngress(c *ExtensionsClient, namespace string) *ingress {
|
||||
}
|
||||
|
||||
// List returns a list of ingress that match the label and field selectors.
|
||||
func (c *ingress) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.IngressList, err error) {
|
||||
func (c *ingress) List(opts unversioned.ListOptions) (result *extensions.IngressList, err error) {
|
||||
result = &extensions.IngressList{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("ingresses").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.r.Get().Namespace(c.ns).Resource("ingresses").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getIngressResourceName() string {
|
||||
@ -57,7 +55,7 @@ func TestListIngress(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
receivedIngressList, err := c.Setup(t).Extensions().Ingress(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
receivedIngressList, err := c.Setup(t).Extensions().Ingress(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, receivedIngressList, err)
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/latest"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -33,7 +31,7 @@ type JobsNamespacer interface {
|
||||
|
||||
// JobInterface exposes methods to work on Job resources.
|
||||
type JobInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.JobList, error)
|
||||
List(opts unversioned.ListOptions) (*extensions.JobList, error)
|
||||
Get(name string) (*extensions.Job, error)
|
||||
Create(job *extensions.Job) (*extensions.Job, error)
|
||||
Update(job *extensions.Job) (*extensions.Job, error)
|
||||
@ -57,9 +55,9 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *extensions.JobList, err error) {
|
||||
func (c *jobs) List(opts unversioned.ListOptions) (result *extensions.JobList, err error) {
|
||||
result = &extensions.JobList{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("jobs").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.r.Get().Namespace(c.ns).Resource("jobs").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getJobResourceName() string {
|
||||
@ -57,7 +55,7 @@ func TestListJobs(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
receivedJobList, err := c.Setup(t).Extensions().Jobs(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
receivedJobList, err := c.Setup(t).Extensions().Jobs(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, receivedJobList, err)
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,6 @@ import (
|
||||
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -33,7 +31,7 @@ type LimitRangesNamespacer interface {
|
||||
|
||||
// LimitRangeInterface has methods to work with LimitRange resources.
|
||||
type LimitRangeInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.LimitRangeList, error)
|
||||
List(opts unversioned.ListOptions) (*api.LimitRangeList, error)
|
||||
Get(name string) (*api.LimitRange, error)
|
||||
Delete(name string) error
|
||||
Create(limitRange *api.LimitRange) (*api.LimitRange, error)
|
||||
@ -56,9 +54,9 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.LimitRangeList, err error) {
|
||||
func (c *limitRanges) List(opts unversioned.ListOptions) (result *api.LimitRangeList, err error) {
|
||||
result = &api.LimitRangeList{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("limitRanges").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.r.Get().Namespace(c.ns).Resource("limitRanges").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getLimitRangesResourceName() string {
|
||||
@ -123,7 +121,7 @@ func TestLimitRangeList(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: limitRangeList},
|
||||
}
|
||||
response, err := c.Setup(t).LimitRanges(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).LimitRanges(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, response, err)
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,6 @@ import (
|
||||
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -33,7 +31,7 @@ type NamespacesInterface interface {
|
||||
type NamespaceInterface interface {
|
||||
Create(item *api.Namespace) (*api.Namespace, error)
|
||||
Get(name string) (result *api.Namespace, err error)
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NamespaceList, error)
|
||||
List(opts unversioned.ListOptions) (*api.NamespaceList, error)
|
||||
Delete(name string) error
|
||||
Update(item *api.Namespace) (*api.Namespace, error)
|
||||
Watch(opts unversioned.ListOptions) (watch.Interface, error)
|
||||
@ -59,13 +57,11 @@ func (c *namespaces) Create(namespace *api.Namespace) (*api.Namespace, error) {
|
||||
}
|
||||
|
||||
// List lists all the namespaces in the cluster.
|
||||
func (c *namespaces) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NamespaceList, error) {
|
||||
func (c *namespaces) List(opts unversioned.ListOptions) (*api.NamespaceList, error) {
|
||||
result := &api.NamespaceList{}
|
||||
err := c.r.Get().
|
||||
Resource("namespaces").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
Do().Into(result)
|
||||
return result, err
|
||||
}
|
||||
|
@ -23,8 +23,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func TestNamespaceCreate(t *testing.T) {
|
||||
@ -93,7 +91,7 @@ func TestNamespaceList(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: namespaceList},
|
||||
}
|
||||
response, err := c.Setup(t).Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).Namespaces().List(unversioned.ListOptions{})
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("%#v should be nil.", err)
|
||||
|
@ -21,8 +21,6 @@ import (
|
||||
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -33,7 +31,7 @@ type NodesInterface interface {
|
||||
type NodeInterface interface {
|
||||
Get(name string) (result *api.Node, err error)
|
||||
Create(node *api.Node) (*api.Node, error)
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error)
|
||||
List(opts unversioned.ListOptions) (*api.NodeList, error)
|
||||
Delete(name string) error
|
||||
Update(*api.Node) (*api.Node, error)
|
||||
UpdateStatus(*api.Node) (*api.Node, error)
|
||||
@ -63,9 +61,9 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error) {
|
||||
func (c *nodes) List(opts unversioned.ListOptions) (*api.NodeList, error) {
|
||||
result := &api.NodeList{}
|
||||
err := c.r.Get().Resource(c.resourceName()).VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err := c.r.Get().Resource(c.resourceName()).VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return result, err
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
@ -40,7 +39,7 @@ func TestListNodes(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: &api.NodeList{ListMeta: unversioned.ListMeta{ResourceVersion: "1"}}},
|
||||
}
|
||||
response, err := c.Setup(t).Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).Nodes().List(unversioned.ListOptions{})
|
||||
c.Validate(t, response, err)
|
||||
}
|
||||
|
||||
@ -70,7 +69,8 @@ func TestListNodesLabels(t *testing.T) {
|
||||
c.Setup(t)
|
||||
c.QueryValidator[labelSelectorQueryParamName] = validateLabels
|
||||
selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector()
|
||||
receivedNodeList, err := c.Nodes().List(selector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
receivedNodeList, err := c.Nodes().List(options)
|
||||
c.Validate(t, receivedNodeList, err)
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getPersistentVolumesResoureName() string {
|
||||
@ -107,7 +105,7 @@ func TestPersistentVolumeList(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: persistentVolumeList},
|
||||
}
|
||||
response, err := c.Setup(t).PersistentVolumes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).PersistentVolumes().List(unversioned.ListOptions{})
|
||||
c.Validate(t, response, err)
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,6 @@ import (
|
||||
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -33,7 +31,7 @@ type PersistentVolumeClaimsNamespacer interface {
|
||||
|
||||
// PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources.
|
||||
type PersistentVolumeClaimInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PersistentVolumeClaimList, error)
|
||||
List(opts unversioned.ListOptions) (*api.PersistentVolumeClaimList, error)
|
||||
Get(name string) (*api.PersistentVolumeClaim, error)
|
||||
Create(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)
|
||||
Update(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error)
|
||||
@ -53,15 +51,13 @@ func newPersistentVolumeClaims(c *Client, namespace string) *persistentVolumeCla
|
||||
return &persistentVolumeClaims{c, namespace}
|
||||
}
|
||||
|
||||
func (c *persistentVolumeClaims) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.PersistentVolumeClaimList, err error) {
|
||||
func (c *persistentVolumeClaims) List(opts unversioned.ListOptions) (result *api.PersistentVolumeClaimList, err error) {
|
||||
result = &api.PersistentVolumeClaimList{}
|
||||
|
||||
err = c.client.Get().
|
||||
Namespace(c.namespace).
|
||||
Resource("persistentVolumeClaims").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
Do().
|
||||
Into(result)
|
||||
|
||||
|
@ -24,8 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getPersistentVolumeClaimsResoureName() string {
|
||||
@ -116,7 +114,7 @@ func TestPersistentVolumeClaimList(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: persistentVolumeList},
|
||||
}
|
||||
response, err := c.Setup(t).PersistentVolumeClaims(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).PersistentVolumeClaims(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, response, err)
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,6 @@ import (
|
||||
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -32,7 +30,7 @@ type PersistentVolumesInterface interface {
|
||||
|
||||
// PersistentVolumeInterface has methods to work with PersistentVolume resources.
|
||||
type PersistentVolumeInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PersistentVolumeList, error)
|
||||
List(opts unversioned.ListOptions) (*api.PersistentVolumeList, error)
|
||||
Get(name string) (*api.PersistentVolume, error)
|
||||
Create(volume *api.PersistentVolume) (*api.PersistentVolume, error)
|
||||
Update(volume *api.PersistentVolume) (*api.PersistentVolume, error)
|
||||
@ -50,13 +48,11 @@ func newPersistentVolumes(c *Client) *persistentVolumes {
|
||||
return &persistentVolumes{c}
|
||||
}
|
||||
|
||||
func (c *persistentVolumes) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.PersistentVolumeList, err error) {
|
||||
func (c *persistentVolumes) List(opts unversioned.ListOptions) (result *api.PersistentVolumeList, err error) {
|
||||
result = &api.PersistentVolumeList{}
|
||||
err = c.client.Get().
|
||||
Resource("persistentVolumes").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
Do().
|
||||
Into(result)
|
||||
|
||||
|
@ -19,8 +19,6 @@ package unversioned
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -31,7 +29,7 @@ type PodTemplatesNamespacer interface {
|
||||
|
||||
// PodTemplateInterface has methods to work with PodTemplate resources.
|
||||
type PodTemplateInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PodTemplateList, error)
|
||||
List(opts unversioned.ListOptions) (*api.PodTemplateList, error)
|
||||
Get(name string) (*api.PodTemplate, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
Create(podTemplate *api.PodTemplate) (*api.PodTemplate, error)
|
||||
@ -54,9 +52,9 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.PodTemplateList, err error) {
|
||||
func (c *podTemplates) List(opts unversioned.ListOptions) (result *api.PodTemplateList, err error) {
|
||||
result = &api.PodTemplateList{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("podTemplates").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.r.Get().Namespace(c.ns).Resource("podTemplates").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getPodTemplatesResoureName() string {
|
||||
@ -98,7 +96,7 @@ func TestPodTemplateList(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: podTemplateList},
|
||||
}
|
||||
response, err := c.Setup(t).PodTemplates(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).PodTemplates(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, response, err)
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,6 @@ package unversioned
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -31,7 +29,7 @@ type PodsNamespacer interface {
|
||||
|
||||
// PodInterface has methods to work with Pod resources.
|
||||
type PodInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PodList, error)
|
||||
List(opts unversioned.ListOptions) (*api.PodList, error)
|
||||
Get(name string) (*api.Pod, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
Create(pod *api.Pod) (*api.Pod, error)
|
||||
@ -57,9 +55,9 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.PodList, err error) {
|
||||
func (c *pods) List(opts unversioned.ListOptions) (result *api.PodList, err error) {
|
||||
result = &api.PodList{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("pods").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.r.Get().Namespace(c.ns).Resource("pods").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
@ -34,7 +33,7 @@ func TestListEmptyPods(t *testing.T) {
|
||||
Request: testRequest{Method: "GET", Path: testapi.Default.ResourcePath("pods", ns, ""), Query: buildQueryValues(nil)},
|
||||
Response: Response{StatusCode: http.StatusOK, Body: &api.PodList{}},
|
||||
}
|
||||
podList, err := c.Setup(t).Pods(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
podList, err := c.Setup(t).Pods(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, podList, err)
|
||||
}
|
||||
|
||||
@ -60,7 +59,7 @@ func TestListPods(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
receivedPodList, err := c.Setup(t).Pods(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
receivedPodList, err := c.Setup(t).Pods(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, receivedPodList, err)
|
||||
}
|
||||
|
||||
@ -94,7 +93,8 @@ func TestListPodsLabels(t *testing.T) {
|
||||
c.Setup(t)
|
||||
c.QueryValidator[labelSelectorQueryParamName] = validateLabels
|
||||
selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector()
|
||||
receivedPodList, err := c.Pods(ns).List(selector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
receivedPodList, err := c.Pods(ns).List(options)
|
||||
c.Validate(t, receivedPodList, err)
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,6 @@ package unversioned
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -31,7 +29,7 @@ type ReplicationControllersNamespacer interface {
|
||||
|
||||
// ReplicationControllerInterface has methods to work with ReplicationController resources.
|
||||
type ReplicationControllerInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ReplicationControllerList, error)
|
||||
List(opts unversioned.ListOptions) (*api.ReplicationControllerList, error)
|
||||
Get(name string) (*api.ReplicationController, error)
|
||||
Create(ctrl *api.ReplicationController) (*api.ReplicationController, error)
|
||||
Update(ctrl *api.ReplicationController) (*api.ReplicationController, error)
|
||||
@ -52,9 +50,9 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.ReplicationControllerList, err error) {
|
||||
func (c *replicationControllers) List(opts unversioned.ListOptions) (result *api.ReplicationControllerList, err error) {
|
||||
result = &api.ReplicationControllerList{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("replicationControllers").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.r.Get().Namespace(c.ns).Resource("replicationControllers").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -22,8 +22,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getRCResourceName() string {
|
||||
@ -57,7 +55,7 @@ func TestListControllers(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
receivedControllerList, err := c.Setup(t).ReplicationControllers(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
receivedControllerList, err := c.Setup(t).ReplicationControllers(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, receivedControllerList, err)
|
||||
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package unversioned
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -31,7 +29,7 @@ type ResourceQuotasNamespacer interface {
|
||||
|
||||
// ResourceQuotaInterface has methods to work with ResourceQuota resources.
|
||||
type ResourceQuotaInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ResourceQuotaList, error)
|
||||
List(opts unversioned.ListOptions) (*api.ResourceQuotaList, error)
|
||||
Get(name string) (*api.ResourceQuota, error)
|
||||
Delete(name string) error
|
||||
Create(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error)
|
||||
@ -55,9 +53,9 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.ResourceQuotaList, err error) {
|
||||
func (c *resourceQuotas) List(opts unversioned.ListOptions) (result *api.ResourceQuotaList, err error) {
|
||||
result = &api.ResourceQuotaList{}
|
||||
err = c.r.Get().Namespace(c.ns).Resource("resourceQuotas").VersionedParams(&opts, api.Scheme).LabelsSelectorParam(label).FieldsSelectorParam(field).Do().Into(result)
|
||||
err = c.r.Get().Namespace(c.ns).Resource("resourceQuotas").VersionedParams(&opts, api.Scheme).Do().Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
func getResourceQuotasResoureName() string {
|
||||
@ -115,7 +113,7 @@ func TestResourceQuotaList(t *testing.T) {
|
||||
},
|
||||
Response: Response{StatusCode: 200, Body: resourceQuotaList},
|
||||
}
|
||||
response, err := c.Setup(t).ResourceQuotas(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
response, err := c.Setup(t).ResourceQuotas(ns).List(unversioned.ListOptions{})
|
||||
c.Validate(t, response, err)
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,6 @@ package unversioned
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -32,7 +30,7 @@ type SecretsInterface interface {
|
||||
Create(secret *api.Secret) (*api.Secret, error)
|
||||
Update(secret *api.Secret) (*api.Secret, error)
|
||||
Delete(name string) error
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.SecretList, error)
|
||||
List(opts unversioned.ListOptions) (*api.SecretList, error)
|
||||
Get(name string) (*api.Secret, error)
|
||||
Watch(opts unversioned.ListOptions) (watch.Interface, error)
|
||||
}
|
||||
@ -64,15 +62,13 @@ func (s *secrets) Create(secret *api.Secret) (*api.Secret, error) {
|
||||
}
|
||||
|
||||
// List returns a list of secrets matching the selectors.
|
||||
func (s *secrets) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.SecretList, error) {
|
||||
func (s *secrets) List(opts unversioned.ListOptions) (*api.SecretList, error) {
|
||||
result := &api.SecretList{}
|
||||
|
||||
err := s.client.Get().
|
||||
Namespace(s.namespace).
|
||||
Resource("secrets").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
Do().
|
||||
Into(result)
|
||||
|
||||
|
@ -19,8 +19,6 @@ package unversioned
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -32,7 +30,7 @@ type ServiceAccountsInterface interface {
|
||||
Create(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)
|
||||
Update(serviceAccount *api.ServiceAccount) (*api.ServiceAccount, error)
|
||||
Delete(name string) error
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceAccountList, error)
|
||||
List(opts unversioned.ListOptions) (*api.ServiceAccountList, error)
|
||||
Get(name string) (*api.ServiceAccount, error)
|
||||
Watch(opts unversioned.ListOptions) (watch.Interface, error)
|
||||
}
|
||||
@ -64,15 +62,13 @@ func (s *serviceAccounts) Create(serviceAccount *api.ServiceAccount) (*api.Servi
|
||||
}
|
||||
|
||||
// List returns a list of serviceAccounts matching the selectors.
|
||||
func (s *serviceAccounts) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceAccountList, error) {
|
||||
func (s *serviceAccounts) List(opts unversioned.ListOptions) (*api.ServiceAccountList, error) {
|
||||
result := &api.ServiceAccountList{}
|
||||
|
||||
err := s.client.Get().
|
||||
Namespace(s.namespace).
|
||||
Resource("serviceAccounts").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
Do().
|
||||
Into(result)
|
||||
|
||||
|
@ -19,8 +19,6 @@ package unversioned
|
||||
import (
|
||||
"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"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
@ -32,7 +30,7 @@ type ServicesNamespacer interface {
|
||||
|
||||
// ServiceInterface has methods to work with Service resources.
|
||||
type ServiceInterface interface {
|
||||
List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceList, error)
|
||||
List(opts unversioned.ListOptions) (*api.ServiceList, error)
|
||||
Get(name string) (*api.Service, error)
|
||||
Create(srv *api.Service) (*api.Service, error)
|
||||
Update(srv *api.Service) (*api.Service, error)
|
||||
@ -53,14 +51,12 @@ 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(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (result *api.ServiceList, err error) {
|
||||
func (c *services) List(opts unversioned.ListOptions) (result *api.ServiceList, err error) {
|
||||
result = &api.ServiceList{}
|
||||
err = c.r.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
LabelsSelectorParam(label).
|
||||
FieldsSelectorParam(field).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
|
@ -23,7 +23,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
)
|
||||
|
||||
@ -55,7 +54,7 @@ func TestListServices(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
receivedServiceList, err := c.Setup(t).Services(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
receivedServiceList, err := c.Setup(t).Services(ns).List(unversioned.ListOptions{})
|
||||
t.Logf("received services: %v %#v", err, receivedServiceList)
|
||||
c.Validate(t, receivedServiceList, err)
|
||||
}
|
||||
@ -92,7 +91,8 @@ func TestListServicesLabels(t *testing.T) {
|
||||
c.Setup(t)
|
||||
c.QueryValidator[labelSelectorQueryParamName] = validateLabels
|
||||
selector := labels.Set{"foo": "bar", "name": "baz"}.AsSelector()
|
||||
receivedServiceList, err := c.Services(ns).List(selector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
receivedServiceList, err := c.Services(ns).List(options)
|
||||
c.Validate(t, receivedServiceList, err)
|
||||
}
|
||||
|
||||
|
@ -44,21 +44,37 @@ func NewGetAction(resource, namespace, name string) GetActionImpl {
|
||||
return action
|
||||
}
|
||||
|
||||
func NewRootListAction(resource string, label labels.Selector, field fields.Selector) ListActionImpl {
|
||||
func NewRootListAction(resource string, opts unversioned.ListOptions) ListActionImpl {
|
||||
action := ListActionImpl{}
|
||||
action.Verb = "list"
|
||||
action.Resource = resource
|
||||
action.ListRestrictions = ListRestrictions{label, field}
|
||||
labelSelector := opts.LabelSelector.Selector
|
||||
if labelSelector == nil {
|
||||
labelSelector = labels.Everything()
|
||||
}
|
||||
fieldSelector := opts.FieldSelector.Selector
|
||||
if fieldSelector == nil {
|
||||
fieldSelector = fields.Everything()
|
||||
}
|
||||
action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
func NewListAction(resource, namespace string, label labels.Selector, field fields.Selector) ListActionImpl {
|
||||
func NewListAction(resource, namespace string, opts unversioned.ListOptions) ListActionImpl {
|
||||
action := ListActionImpl{}
|
||||
action.Verb = "list"
|
||||
action.Resource = resource
|
||||
action.Namespace = namespace
|
||||
action.ListRestrictions = ListRestrictions{label, field}
|
||||
labelSelector := opts.LabelSelector.Selector
|
||||
if labelSelector == nil {
|
||||
labelSelector = labels.Everything()
|
||||
}
|
||||
fieldSelector := opts.FieldSelector.Selector
|
||||
if fieldSelector == nil {
|
||||
fieldSelector = fields.Everything()
|
||||
}
|
||||
action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector}
|
||||
|
||||
return action
|
||||
}
|
||||
|
@ -18,8 +18,7 @@ package testclient
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
)
|
||||
|
||||
// Fake implements ComponentStatusInterface.
|
||||
@ -36,8 +35,8 @@ func (c *FakeComponentStatuses) Get(name string) (*api.ComponentStatus, error) {
|
||||
return obj.(*api.ComponentStatus), err
|
||||
}
|
||||
|
||||
func (c *FakeComponentStatuses) List(label labels.Selector, field fields.Selector) (result *api.ComponentStatusList, err error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("componentstatuses", label, field), &api.ComponentStatusList{})
|
||||
func (c *FakeComponentStatuses) List(opts unversioned.ListOptions) (result *api.ComponentStatusList, err error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("componentstatuses", opts), &api.ComponentStatusList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -20,8 +20,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
kclientlib "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -43,8 +41,8 @@ func (c *FakeDaemonSets) Get(name string) (*extensions.DaemonSet, error) {
|
||||
return obj.(*extensions.DaemonSet), err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.DaemonSetList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("daemonsets", c.Namespace, label, field), &extensions.DaemonSetList{})
|
||||
func (c *FakeDaemonSets) List(opts unversioned.ListOptions) (*extensions.DaemonSetList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("daemonsets", c.Namespace, opts), &extensions.DaemonSetList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
@ -41,11 +40,15 @@ func (c *FakeDeployments) Get(name string) (*extensions.Deployment, error) {
|
||||
return obj.(*extensions.Deployment), err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.DeploymentList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("deployments", c.Namespace, label, field), &extensions.DeploymentList{})
|
||||
func (c *FakeDeployments) List(opts unversioned.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
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &extensions.DeploymentList{}
|
||||
for _, deployment := range obj.(*extensions.DeploymentList).Items {
|
||||
if label.Matches(labels.Set(deployment.Labels)) {
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -40,8 +38,8 @@ func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error) {
|
||||
return obj.(*api.Endpoints), err
|
||||
}
|
||||
|
||||
func (c *FakeEndpoints) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EndpointsList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("endpoints", c.Namespace, label, field), &api.EndpointsList{})
|
||||
func (c *FakeEndpoints) List(opts unversioned.ListOptions) (*api.EndpointsList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("endpoints", c.Namespace, opts), &api.EndpointsList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import (
|
||||
"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/runtime"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
@ -47,10 +46,10 @@ func (c *FakeEvents) Get(name string) (*api.Event, error) {
|
||||
}
|
||||
|
||||
// List returns a list of events matching the selectors.
|
||||
func (c *FakeEvents) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.EventList, error) {
|
||||
action := NewRootListAction("events", label, field)
|
||||
func (c *FakeEvents) List(opts unversioned.ListOptions) (*api.EventList, error) {
|
||||
action := NewRootListAction("events", opts)
|
||||
if c.Namespace != "" {
|
||||
action = NewListAction("events", c.Namespace, label, field)
|
||||
action = NewListAction("events", c.Namespace, opts)
|
||||
}
|
||||
obj, err := c.Fake.Invokes(action, &api.EventList{})
|
||||
if obj == nil {
|
||||
@ -122,9 +121,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", nil, nil)
|
||||
action := NewRootListAction("events", unversioned.ListOptions{})
|
||||
if c.Namespace != "" {
|
||||
action = NewListAction("events", c.Namespace, nil, nil)
|
||||
action = NewListAction("events", c.Namespace, unversioned.ListOptions{})
|
||||
}
|
||||
obj, err := c.Fake.Invokes(action, &api.EventList{})
|
||||
if obj == nil {
|
||||
|
@ -20,7 +20,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
@ -41,11 +40,15 @@ func (c *FakeHorizontalPodAutoscalers) Get(name string) (*extensions.HorizontalP
|
||||
return obj.(*extensions.HorizontalPodAutoscaler), err
|
||||
}
|
||||
|
||||
func (c *FakeHorizontalPodAutoscalers) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*extensions.HorizontalPodAutoscalerList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("horizontalpodautoscalers", c.Namespace, label, field), &extensions.HorizontalPodAutoscalerList{})
|
||||
func (c *FakeHorizontalPodAutoscalers) List(opts unversioned.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
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &extensions.HorizontalPodAutoscalerList{}
|
||||
for _, a := range obj.(*extensions.HorizontalPodAutoscalerList).Items {
|
||||
if label.Matches(labels.Set(a.Labels)) {
|
||||
|
@ -20,8 +20,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -41,8 +39,8 @@ func (c *FakeIngress) Get(name string) (*extensions.Ingress, error) {
|
||||
return obj.(*extensions.Ingress), err
|
||||
}
|
||||
|
||||
func (c *FakeIngress) List(label labels.Selector, fields fields.Selector, opts unversioned.ListOptions) (*extensions.IngressList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("ingresses", c.Namespace, label, nil), &extensions.IngressList{})
|
||||
func (c *FakeIngress) List(opts unversioned.ListOptions) (*extensions.IngressList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("ingresses", c.Namespace, opts), &extensions.IngressList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -20,8 +20,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -41,8 +39,8 @@ func (c *FakeJobs) Get(name string) (*extensions.Job, error) {
|
||||
return obj.(*extensions.Job), err
|
||||
}
|
||||
|
||||
func (c *FakeJobs) List(label labels.Selector, fields fields.Selector, opts unversioned.ListOptions) (*extensions.JobList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("jobs", c.Namespace, label, nil), &extensions.JobList{})
|
||||
func (c *FakeJobs) List(opts unversioned.ListOptions) (*extensions.JobList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("jobs", c.Namespace, opts), &extensions.JobList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -40,8 +38,8 @@ func (c *FakeLimitRanges) Get(name string) (*api.LimitRange, error) {
|
||||
return obj.(*api.LimitRange), err
|
||||
}
|
||||
|
||||
func (c *FakeLimitRanges) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.LimitRangeList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("limitranges", c.Namespace, label, field), &api.LimitRangeList{})
|
||||
func (c *FakeLimitRanges) List(opts unversioned.ListOptions) (*api.LimitRangeList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("limitranges", c.Namespace, opts), &api.LimitRangeList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -39,8 +37,8 @@ func (c *FakeNamespaces) Get(name string) (*api.Namespace, error) {
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NamespaceList, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("namespaces", label, field), &api.NamespaceList{})
|
||||
func (c *FakeNamespaces) List(opts unversioned.ListOptions) (*api.NamespaceList, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("namespaces", opts), &api.NamespaceList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -39,8 +37,8 @@ func (c *FakeNodes) Get(name string) (*api.Node, error) {
|
||||
return obj.(*api.Node), err
|
||||
}
|
||||
|
||||
func (c *FakeNodes) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("nodes", label, field), &api.NodeList{})
|
||||
func (c *FakeNodes) List(opts unversioned.ListOptions) (*api.NodeList, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("nodes", opts), &api.NodeList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -38,8 +36,8 @@ func (c *FakePersistentVolumeClaims) Get(name string) (*api.PersistentVolumeClai
|
||||
return obj.(*api.PersistentVolumeClaim), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumeClaims) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PersistentVolumeClaimList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("persistentvolumeclaims", c.Namespace, label, field), &api.PersistentVolumeClaimList{})
|
||||
func (c *FakePersistentVolumeClaims) List(opts unversioned.ListOptions) (*api.PersistentVolumeClaimList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("persistentvolumeclaims", c.Namespace, opts), &api.PersistentVolumeClaimList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -37,8 +35,8 @@ func (c *FakePersistentVolumes) Get(name string) (*api.PersistentVolume, error)
|
||||
return obj.(*api.PersistentVolume), err
|
||||
}
|
||||
|
||||
func (c *FakePersistentVolumes) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PersistentVolumeList, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("persistentvolumes", label, field), &api.PersistentVolumeList{})
|
||||
func (c *FakePersistentVolumes) List(opts unversioned.ListOptions) (*api.PersistentVolumeList, error) {
|
||||
obj, err := c.Fake.Invokes(NewRootListAction("persistentvolumes", opts), &api.PersistentVolumeList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -40,8 +38,8 @@ func (c *FakePodTemplates) Get(name string) (*api.PodTemplate, error) {
|
||||
return obj.(*api.PodTemplate), err
|
||||
}
|
||||
|
||||
func (c *FakePodTemplates) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PodTemplateList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("podtemplates", c.Namespace, label, field), &api.PodTemplateList{})
|
||||
func (c *FakePodTemplates) List(opts unversioned.ListOptions) (*api.PodTemplateList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("podtemplates", c.Namespace, opts), &api.PodTemplateList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import (
|
||||
"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"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
@ -41,11 +40,15 @@ func (c *FakePods) Get(name string) (*api.Pod, error) {
|
||||
return obj.(*api.Pod), err
|
||||
}
|
||||
|
||||
func (c *FakePods) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.PodList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("pods", c.Namespace, label, field), &api.PodList{})
|
||||
func (c *FakePods) List(opts unversioned.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
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &api.PodList{}
|
||||
for _, pod := range obj.(*api.PodList).Items {
|
||||
if label.Matches(labels.Set(pod.Labels)) {
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -40,8 +38,8 @@ func (c *FakeReplicationControllers) Get(name string) (*api.ReplicationControlle
|
||||
return obj.(*api.ReplicationController), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicationControllers) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ReplicationControllerList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("replicationcontrollers", c.Namespace, label, field), &api.ReplicationControllerList{})
|
||||
func (c *FakeReplicationControllers) List(opts unversioned.ListOptions) (*api.ReplicationControllerList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("replicationcontrollers", c.Namespace, opts), &api.ReplicationControllerList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -40,8 +38,8 @@ func (c *FakeResourceQuotas) Get(name string) (*api.ResourceQuota, error) {
|
||||
return obj.(*api.ResourceQuota), err
|
||||
}
|
||||
|
||||
func (c *FakeResourceQuotas) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ResourceQuotaList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("resourcequotas", c.Namespace, label, field), &api.ResourceQuotaList{})
|
||||
func (c *FakeResourceQuotas) List(opts unversioned.ListOptions) (*api.ResourceQuotaList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("resourcequotas", c.Namespace, opts), &api.ResourceQuotaList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -40,8 +38,8 @@ func (c *FakeSecrets) Get(name string) (*api.Secret, error) {
|
||||
return obj.(*api.Secret), err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.SecretList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("secrets", c.Namespace, label, field), &api.SecretList{})
|
||||
func (c *FakeSecrets) List(opts unversioned.ListOptions) (*api.SecretList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("secrets", c.Namespace, opts), &api.SecretList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ package testclient
|
||||
import (
|
||||
"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/watch"
|
||||
)
|
||||
|
||||
@ -40,8 +38,8 @@ func (c *FakeServiceAccounts) Get(name string) (*api.ServiceAccount, error) {
|
||||
return obj.(*api.ServiceAccount), err
|
||||
}
|
||||
|
||||
func (c *FakeServiceAccounts) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceAccountList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("serviceaccounts", c.Namespace, label, field), &api.ServiceAccountList{})
|
||||
func (c *FakeServiceAccounts) List(opts unversioned.ListOptions) (*api.ServiceAccountList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("serviceaccounts", c.Namespace, opts), &api.ServiceAccountList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -20,8 +20,6 @@ import (
|
||||
"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"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
@ -41,8 +39,8 @@ func (c *FakeServices) Get(name string) (*api.Service, error) {
|
||||
return obj.(*api.Service), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.ServiceList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("services", c.Namespace, label, field), &api.ServiceList{})
|
||||
func (c *FakeServices) List(opts unversioned.ListOptions) (*api.ServiceList, error) {
|
||||
obj, err := c.Fake.Invokes(NewListAction("services", c.Namespace, opts), &api.ServiceList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -23,8 +23,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/errors"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
@ -35,7 +33,7 @@ func TestNewClient(t *testing.T) {
|
||||
}
|
||||
client := &Fake{}
|
||||
client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper()))
|
||||
list, err := client.Services("test").List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
list, err := client.Services("test").List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -44,7 +42,7 @@ func TestNewClient(t *testing.T) {
|
||||
}
|
||||
|
||||
// When list is invoked a second time, the same results are returned.
|
||||
list, err = client.Services("test").List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
list, err = client.Services("test").List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -66,12 +64,12 @@ func TestErrors(t *testing.T) {
|
||||
})
|
||||
client := &Fake{}
|
||||
client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper()))
|
||||
_, err := client.Services("test").List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
_, err := client.Services("test").List(unversioned.ListOptions{})
|
||||
if !errors.IsNotFound(err) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
t.Logf("error: %#v", err.(*errors.StatusError).Status())
|
||||
_, err = client.Services("test").List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
_, err = client.Services("test").List(unversioned.ListOptions{})
|
||||
if !errors.IsForbidden(err) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
@ -98,7 +97,7 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
|
||||
dsc.dsStore.Store, dsc.dsController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return dsc.kubeClient.Extensions().DaemonSets(api.NamespaceAll).Watch(options)
|
||||
@ -130,7 +129,7 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
|
||||
dsc.podStore.Store, dsc.podController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return dsc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return dsc.kubeClient.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return dsc.kubeClient.Pods(api.NamespaceAll).Watch(options)
|
||||
@ -148,7 +147,7 @@ func NewDaemonSetsController(kubeClient client.Interface, resyncPeriod controlle
|
||||
dsc.nodeStore.Store, dsc.nodeController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return dsc.kubeClient.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return dsc.kubeClient.Nodes().List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return dsc.kubeClient.Nodes().Watch(options)
|
||||
|
@ -27,8 +27,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
"k8s.io/kubernetes/pkg/client/record"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
deploymentutil "k8s.io/kubernetes/pkg/util/deployment"
|
||||
)
|
||||
@ -61,7 +59,7 @@ func (d *DeploymentController) Run(syncPeriod time.Duration) {
|
||||
}
|
||||
|
||||
func (d *DeploymentController) reconcileDeployments() []error {
|
||||
list, err := d.expClient.Deployments(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
list, err := d.expClient.Deployments(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return []error{fmt.Errorf("error listing deployments: %v", err)}
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
@ -64,7 +63,7 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
|
||||
e.serviceStore.Store, e.serviceController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return e.client.Services(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return e.client.Services(api.NamespaceAll).Watch(options)
|
||||
@ -85,7 +84,7 @@ func NewEndpointController(client *client.Client, resyncPeriod controller.Resync
|
||||
e.podStore.Store, e.podController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return e.client.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return e.client.Pods(api.NamespaceAll).Watch(options)
|
||||
@ -386,7 +385,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
list, err := e.client.Endpoints(api.NamespaceAll).List(unversioned.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
|
||||
|
@ -67,7 +67,8 @@ func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc,
|
||||
gcc.podStore.Store, gcc.podStoreSyncer = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return gcc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), terminatedSelector, unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{terminatedSelector}}
|
||||
return gcc.kubeClient.Pods(api.NamespaceAll).List(options)
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
options.FieldSelector.Selector = terminatedSelector
|
||||
|
@ -32,8 +32,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/controller"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
replicationcontroller "k8s.io/kubernetes/pkg/controller/replication"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/workqueue"
|
||||
@ -86,7 +84,7 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn
|
||||
jm.jobStore.Store, jm.jobController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return jm.kubeClient.Extensions().Jobs(api.NamespaceAll).Watch(options)
|
||||
@ -109,7 +107,7 @@ func NewJobController(kubeClient client.Interface, resyncPeriod controller.Resyn
|
||||
jm.podStore.Store, jm.podController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return jm.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return jm.kubeClient.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return jm.kubeClient.Pods(api.NamespaceAll).Watch(options)
|
||||
|
@ -26,8 +26,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
@ -48,7 +46,7 @@ func NewNamespaceController(kubeClient client.Interface, versions *unversioned.A
|
||||
_, controller = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return kubeClient.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return kubeClient.Namespaces().List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return kubeClient.Namespaces().Watch(options)
|
||||
@ -339,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := kubeClient.LimitRanges(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -353,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
resourceQuotas, err := kubeClient.ResourceQuotas(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -367,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := kubeClient.ServiceAccounts(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -381,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := kubeClient.Services(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -395,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := kubeClient.ReplicationControllers(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -409,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := kubeClient.Pods(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@ -438,7 +436,7 @@ func deletePods(kubeClient client.Interface, ns string, before unversioned.Time)
|
||||
}
|
||||
|
||||
func deleteEvents(kubeClient client.Interface, ns string) error {
|
||||
items, err := kubeClient.Events(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := kubeClient.Events(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -452,7 +450,7 @@ func deleteEvents(kubeClient client.Interface, ns string) error {
|
||||
}
|
||||
|
||||
func deleteSecrets(kubeClient client.Interface, ns string) error {
|
||||
items, err := kubeClient.Secrets(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := kubeClient.Secrets(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -466,7 +464,7 @@ func deleteSecrets(kubeClient client.Interface, ns string) error {
|
||||
}
|
||||
|
||||
func deletePersistentVolumeClaims(kubeClient client.Interface, ns string) error {
|
||||
items, err := kubeClient.PersistentVolumeClaims(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := kubeClient.PersistentVolumeClaims(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -480,7 +478,7 @@ func deletePersistentVolumeClaims(kubeClient client.Interface, ns string) error
|
||||
}
|
||||
|
||||
func deleteHorizontalPodAutoscalers(expClient client.ExtensionsInterface, ns string) error {
|
||||
items, err := expClient.HorizontalPodAutoscalers(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := expClient.HorizontalPodAutoscalers(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -494,7 +492,7 @@ func deleteHorizontalPodAutoscalers(expClient client.ExtensionsInterface, ns str
|
||||
}
|
||||
|
||||
func deleteDaemonSets(expClient client.ExtensionsInterface, ns string) error {
|
||||
items, err := expClient.DaemonSets(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := expClient.DaemonSets(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -508,7 +506,7 @@ func deleteDaemonSets(expClient client.ExtensionsInterface, ns string) error {
|
||||
}
|
||||
|
||||
func deleteJobs(expClient client.ExtensionsInterface, ns string) error {
|
||||
items, err := expClient.Jobs(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := expClient.Jobs(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -522,7 +520,7 @@ func deleteJobs(expClient client.ExtensionsInterface, ns string) error {
|
||||
}
|
||||
|
||||
func deleteDeployments(expClient client.ExtensionsInterface, ns string) error {
|
||||
items, err := expClient.Deployments(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := expClient.Deployments(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -536,7 +534,7 @@ func deleteDeployments(expClient client.ExtensionsInterface, ns string) error {
|
||||
}
|
||||
|
||||
func deleteIngress(expClient client.ExtensionsInterface, ns string) error {
|
||||
items, err := expClient.Ingress(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := expClient.Ingress(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/controller"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"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"
|
||||
@ -164,7 +163,7 @@ func NewNodeController(
|
||||
nc.podStore.Store, nc.podController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return nc.kubeClient.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return nc.kubeClient.Pods(api.NamespaceAll).Watch(options)
|
||||
@ -180,7 +179,7 @@ func NewNodeController(
|
||||
nc.nodeStore.Store, nc.nodeController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return nc.kubeClient.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return nc.kubeClient.Nodes().List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return nc.kubeClient.Nodes().Watch(options)
|
||||
@ -347,7 +346,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodes, err := nc.kubeClient.Nodes().List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -684,7 +683,9 @@ func (nc *NodeController) tryUpdateNodeStatus(node *api.Node) (time.Duration, ap
|
||||
// returns true if the provided node still has pods scheduled to it, or an error if
|
||||
// the server could not be contacted.
|
||||
func (nc *NodeController) hasPods(nodeName string) (bool, error) {
|
||||
pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.OneTermEqualSelector(client.PodHost, nodeName), unversioned.ListOptions{})
|
||||
selector := fields.OneTermEqualSelector(client.PodHost, nodeName)
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}}
|
||||
pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(options)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
@ -717,7 +718,9 @@ func (nc *NodeController) cancelPodEviction(nodeName string) bool {
|
||||
// if any pods were deleted.
|
||||
func (nc *NodeController) deletePods(nodeName string) (bool, error) {
|
||||
remaining := false
|
||||
pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.OneTermEqualSelector(client.PodHost, nodeName), unversioned.ListOptions{})
|
||||
selector := fields.OneTermEqualSelector(client.PodHost, nodeName)
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}}
|
||||
pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(options)
|
||||
if err != nil {
|
||||
return remaining, err
|
||||
}
|
||||
@ -755,9 +758,9 @@ func (nc *NodeController) terminatePods(nodeName string, since time.Time) (bool,
|
||||
// have we deleted all pods
|
||||
complete := true
|
||||
|
||||
pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(),
|
||||
fields.OneTermEqualSelector(client.PodHost, nodeName),
|
||||
unversioned.ListOptions{})
|
||||
selector := fields.OneTermEqualSelector(client.PodHost, nodeName)
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}}
|
||||
pods, err := nc.kubeClient.Pods(api.NamespaceAll).List(options)
|
||||
if err != nil {
|
||||
return false, nextAttempt, err
|
||||
}
|
||||
|
@ -29,8 +29,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/client/unversioned/testclient"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
@ -91,7 +89,7 @@ func (m *FakeNodeHandler) Get(name string) (*api.Node, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *FakeNodeHandler) List(label labels.Selector, field fields.Selector, opts unversioned.ListOptions) (*api.NodeList, error) {
|
||||
func (m *FakeNodeHandler) List(opts unversioned.ListOptions) (*api.NodeList, error) {
|
||||
defer func() { m.RequestCount++ }()
|
||||
var nodes []*api.Node
|
||||
for i := 0; i < len(m.UpdatedNodes); i++ {
|
||||
|
@ -28,8 +28,6 @@ import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/conversion"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
|
||||
@ -58,7 +56,7 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time
|
||||
_, volumeController := framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return kubeClient.PersistentVolumes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return kubeClient.PersistentVolumes().List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return kubeClient.PersistentVolumes().Watch(options)
|
||||
@ -76,7 +74,7 @@ func NewPersistentVolumeClaimBinder(kubeClient client.Interface, syncPeriod time
|
||||
_, claimController := framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return kubeClient.PersistentVolumeClaims(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return kubeClient.PersistentVolumeClaims(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return kubeClient.PersistentVolumeClaims(api.NamespaceAll).Watch(options)
|
||||
|
@ -27,8 +27,6 @@ import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/cloudprovider"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
ioutil "k8s.io/kubernetes/pkg/util/io"
|
||||
@ -65,7 +63,7 @@ func NewPersistentVolumeRecycler(kubeClient client.Interface, syncPeriod time.Du
|
||||
_, volumeController := framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return kubeClient.PersistentVolumes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return kubeClient.PersistentVolumes().List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return kubeClient.PersistentVolumes().Watch(options)
|
||||
|
@ -28,8 +28,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/client/record"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
)
|
||||
|
||||
@ -175,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
list, err := a.client.Extensions().HorizontalPodAutoscalers(ns).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("error listing nodes: %v", err)
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ import (
|
||||
"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"
|
||||
|
||||
heapster "k8s.io/heapster/api/v1/types"
|
||||
@ -119,8 +118,9 @@ 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(labels.SelectorFromSet(labels.Set(selector)), fields.Everything(), unversioned.ListOptions{})
|
||||
List(unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}})
|
||||
|
||||
if err != nil {
|
||||
return nil, nil, time.Time{}, fmt.Errorf("failed to get pod list: %v", err)
|
||||
|
@ -30,7 +30,6 @@ import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
@ -109,7 +108,7 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
|
||||
rm.rcStore.Store, rm.rcController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return rm.kubeClient.ReplicationControllers(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return rm.kubeClient.ReplicationControllers(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return rm.kubeClient.ReplicationControllers(api.NamespaceAll).Watch(options)
|
||||
@ -150,7 +149,7 @@ func NewReplicationManager(kubeClient client.Interface, resyncPeriod controller.
|
||||
rm.podStore.Store, rm.podController = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return rm.kubeClient.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return rm.kubeClient.Pods(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return rm.kubeClient.Pods(api.NamespaceAll).Watch(options)
|
||||
|
@ -25,8 +25,6 @@ import (
|
||||
"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"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
)
|
||||
|
||||
@ -59,7 +57,7 @@ func (rm *ResourceQuotaController) Run(period time.Duration) {
|
||||
|
||||
func (rm *ResourceQuotaController) synchronize() {
|
||||
var resourceQuotas []api.ResourceQuota
|
||||
list, err := rm.kubeClient.ResourceQuotas(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
list, err := rm.kubeClient.ResourceQuotas(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
glog.Errorf("Synchronization error: %v (%#v)", err, err)
|
||||
}
|
||||
@ -143,7 +141,7 @@ func (rm *ResourceQuotaController) syncResourceQuota(quota api.ResourceQuota) (e
|
||||
|
||||
pods := &api.PodList{}
|
||||
if set[api.ResourcePods] || set[api.ResourceMemory] || set[api.ResourceCPU] {
|
||||
pods, err = rm.kubeClient.Pods(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
pods, err = rm.kubeClient.Pods(usage.Namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -166,31 +164,31 @@ func (rm *ResourceQuotaController) syncResourceQuota(quota api.ResourceQuota) (e
|
||||
case api.ResourcePods:
|
||||
value = resource.NewQuantity(int64(len(filteredPods)), resource.DecimalSI)
|
||||
case api.ResourceServices:
|
||||
items, err := rm.kubeClient.Services(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := rm.kubeClient.Services(usage.Namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI)
|
||||
case api.ResourceReplicationControllers:
|
||||
items, err := rm.kubeClient.ReplicationControllers(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := rm.kubeClient.ReplicationControllers(usage.Namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI)
|
||||
case api.ResourceQuotas:
|
||||
items, err := rm.kubeClient.ResourceQuotas(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := rm.kubeClient.ResourceQuotas(usage.Namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI)
|
||||
case api.ResourceSecrets:
|
||||
items, err := rm.kubeClient.Secrets(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := rm.kubeClient.Secrets(usage.Namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
value = resource.NewQuantity(int64(len(items.Items)), resource.DecimalSI)
|
||||
case api.ResourcePersistentVolumeClaims:
|
||||
items, err := rm.kubeClient.PersistentVolumeClaims(usage.Namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
items, err := rm.kubeClient.PersistentVolumeClaims(usage.Namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -26,8 +26,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/cloudprovider"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
)
|
||||
|
||||
@ -62,7 +60,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodeList, err := rc.kubeClient.Nodes().List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("error listing nodes: %v", err)
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@ -79,7 +78,8 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo
|
||||
e.serviceAccounts, e.serviceAccountController = framework.NewIndexerInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), accountSelector, unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{accountSelector}}
|
||||
return e.client.ServiceAccounts(api.NamespaceAll).List(options)
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
options.FieldSelector.Selector = accountSelector
|
||||
@ -97,7 +97,7 @@ func NewServiceAccountsController(cl client.Interface, options ServiceAccountsCo
|
||||
e.namespaces, e.namespaceController = framework.NewIndexerInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return e.client.Namespaces().List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return e.client.Namespaces().Watch(options)
|
||||
|
@ -29,7 +29,6 @@ import (
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/registry/secret"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
@ -64,7 +63,7 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) *
|
||||
e.serviceAccounts, e.serviceAccountController = framework.NewIndexerInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return e.client.ServiceAccounts(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return e.client.ServiceAccounts(api.NamespaceAll).Watch(options)
|
||||
@ -84,7 +83,8 @@ func NewTokensController(cl client.Interface, options TokensControllerOptions) *
|
||||
e.secrets, e.secretController = framework.NewIndexerInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return e.client.Secrets(api.NamespaceAll).List(labels.Everything(), tokenSelector, unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{tokenSelector}}
|
||||
return e.client.Secrets(api.NamespaceAll).List(options)
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
options.FieldSelector.Selector = tokenSelector
|
||||
|
@ -40,7 +40,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/kubectl"
|
||||
"k8s.io/kubernetes/pkg/kubectl/resource"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
@ -342,7 +341,9 @@ func GetFirstPod(client *client.Client, namespace string, selector map[string]st
|
||||
var pods *api.PodList
|
||||
for pods == nil || len(pods.Items) == 0 {
|
||||
var err error
|
||||
if pods, err = client.Pods(namespace).List(labels.SelectorFromSet(selector), fields.Everything(), unversioned.ListOptions{}); err != nil {
|
||||
labelSelector := labels.SelectorFromSet(selector)
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}}
|
||||
if pods, err = client.Pods(namespace).List(options); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(pods.Items) == 0 {
|
||||
|
@ -141,11 +141,11 @@ func (d *NamespaceDescriber) Describe(namespace, name string) (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
resourceQuotaList, err := d.ResourceQuotas(name).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
resourceQuotaList, err := d.ResourceQuotas(name).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
limitRangeList, err := d.LimitRanges(name).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
limitRangeList, err := d.LimitRanges(name).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@ -422,10 +422,9 @@ func (d *PodDescriber) Describe(namespace, name string) (string, error) {
|
||||
pod, err := pc.Get(name)
|
||||
if err != nil {
|
||||
eventsInterface := d.Events(namespace)
|
||||
events, err2 := eventsInterface.List(
|
||||
labels.Everything(),
|
||||
eventsInterface.GetFieldSelector(&name, &namespace, nil, nil),
|
||||
unversioned.ListOptions{})
|
||||
selector := eventsInterface.GetFieldSelector(&name, &namespace, nil, nil)
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}}
|
||||
events, err2 := eventsInterface.List(options)
|
||||
if err2 == nil && len(events.Items) > 0 {
|
||||
return tabbedString(func(out io.Writer) error {
|
||||
fmt.Fprintf(out, "Pod '%v': error '%v', but found events.\n", name, err)
|
||||
@ -1191,7 +1190,8 @@ func (d *ServiceAccountDescriber) Describe(namespace, name string) (string, erro
|
||||
tokens := []api.Secret{}
|
||||
|
||||
tokenSelector := fields.SelectorFromSet(map[string]string{client.SecretType: string(api.SecretTypeServiceAccountToken)})
|
||||
secrets, err := d.Secrets(namespace).List(labels.Everything(), tokenSelector, unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{tokenSelector}}
|
||||
secrets, err := d.Secrets(namespace).List(options)
|
||||
if err == nil {
|
||||
for _, s := range secrets.Items {
|
||||
name, _ := s.Annotations[api.ServiceAccountNameKey]
|
||||
@ -1268,7 +1268,7 @@ func (d *NodeDescriber) Describe(namespace, name string) (string, error) {
|
||||
}
|
||||
|
||||
var pods []*api.Pod
|
||||
allPods, err := d.Pods(namespace).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
allPods, err := d.Pods(namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@ -1546,7 +1546,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
dss, err := c.List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting daemon set: %v", err)
|
||||
}
|
||||
@ -1573,7 +1573,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
rcs, err := c.List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting replication controllers: %v", err)
|
||||
}
|
||||
@ -1604,7 +1604,8 @@ func printReplicationControllersByLabels(matchingRCs []*api.ReplicationControlle
|
||||
}
|
||||
|
||||
func getPodStatusForController(c client.PodInterface, selector labels.Selector) (running, waiting, succeeded, failed int, err error) {
|
||||
rcPods, err := c.List(selector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
rcPods, err := c.List(options)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/errors"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util/intstr"
|
||||
"k8s.io/kubernetes/pkg/util/wait"
|
||||
@ -364,7 +363,8 @@ func (r *RollingUpdater) pollForReadyPods(interval, timeout time.Duration, oldRc
|
||||
anyReady := false
|
||||
for _, controller := range controllers {
|
||||
selector := labels.Set(controller.Spec.Selector).AsSelector()
|
||||
pods, err := r.c.Pods(controller.Namespace).List(selector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
pods, err := r.c.Pods(controller.Namespace).List(options)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
@ -628,7 +628,9 @@ 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.
|
||||
podList, err := client.Pods(namespace).List(labels.SelectorFromSet(oldRc.Spec.Selector), fields.Everything(), unversioned.ListOptions{})
|
||||
selector := labels.SelectorFromSet(oldRc.Spec.Selector)
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
podList, err := client.Pods(namespace).List(options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -678,7 +680,9 @@ func AddDeploymentKeyToReplicationController(oldRc *api.ReplicationController, c
|
||||
// Clean up any orphaned pods that don't have the new label, this can happen if the rc manager
|
||||
// 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.
|
||||
podList, err = client.Pods(namespace).List(labels.SelectorFromSet(selectorCopy), fields.Everything(), unversioned.ListOptions{})
|
||||
selector = labels.SelectorFromSet(selectorCopy)
|
||||
options = unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
podList, err = client.Pods(namespace).List(options)
|
||||
for ix := range podList.Items {
|
||||
pod := &podList.Items[ix]
|
||||
if value, found := pod.Labels[deploymentKey]; !found || value != deploymentValue {
|
||||
@ -719,7 +723,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
list, err := r.ReplicationControllers(namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
utilerrors "k8s.io/kubernetes/pkg/util/errors"
|
||||
@ -109,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
rcs, err := c.List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting replication controllers: %v", err)
|
||||
}
|
||||
@ -252,7 +251,8 @@ 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.PodSelectorAsSelector(job.Spec.Selector)
|
||||
podList, err := pods.List(selector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
podList, err := pods.List(options)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -62,7 +62,6 @@ import (
|
||||
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
|
||||
kubeletutil "k8s.io/kubernetes/pkg/kubelet/util"
|
||||
"k8s.io/kubernetes/pkg/kubelet/util/queue"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/securitycontext"
|
||||
"k8s.io/kubernetes/pkg/types"
|
||||
@ -234,7 +233,7 @@ func NewMainKubelet(
|
||||
// than an interface. There is no way to construct a list+watcher using resource name.
|
||||
listWatch := &cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return kubeClient.Services(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return kubeClient.Services(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return kubeClient.Services(api.NamespaceAll).Watch(options)
|
||||
@ -251,7 +250,8 @@ func NewMainKubelet(
|
||||
fieldSelector := fields.Set{client.ObjectNameField: nodeName}.AsSelector()
|
||||
listWatch := &cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return kubeClient.Nodes().List(labels.Everything(), fieldSelector, unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{fieldSelector}}
|
||||
return kubeClient.Nodes().List(options)
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
options.FieldSelector.Selector = fieldSelector
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
)
|
||||
@ -33,14 +32,16 @@ import (
|
||||
func GetOldRCs(deployment extensions.Deployment, c client.Interface) ([]*api.ReplicationController, error) {
|
||||
namespace := deployment.ObjectMeta.Namespace
|
||||
// 1. Find all pods whose labels match deployment.Spec.Selector
|
||||
podList, err := c.Pods(namespace).List(labels.SelectorFromSet(deployment.Spec.Selector), fields.Everything(), unversioned.ListOptions{})
|
||||
selector := labels.SelectorFromSet(deployment.Spec.Selector)
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
podList, err := c.Pods(namespace).List(options)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error listing pods: %v", err)
|
||||
}
|
||||
// 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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
rcList, err := c.ReplicationControllers(namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error listing replication controllers: %v", err)
|
||||
}
|
||||
@ -69,7 +70,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
rcList, err := c.ReplicationControllers(namespace).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error listing replication controllers: %v", err)
|
||||
}
|
||||
@ -149,7 +150,9 @@ func GetAvailablePodsForRCs(c client.Interface, rcs []*api.ReplicationController
|
||||
func getPodsForRCs(c client.Interface, replicationControllers []*api.ReplicationController) ([]api.Pod, error) {
|
||||
allPods := []api.Pod{}
|
||||
for _, rc := range replicationControllers {
|
||||
podList, err := c.Pods(rc.ObjectMeta.Namespace).List(labels.SelectorFromSet(rc.Spec.Selector), fields.Everything(), unversioned.ListOptions{})
|
||||
selector := labels.SelectorFromSet(rc.Spec.Selector)
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
podList, err := c.Pods(rc.ObjectMeta.Namespace).List(options)
|
||||
if err != nil {
|
||||
return allPods, fmt.Errorf("error listing pods: %v", err)
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
|
||||
@ -110,7 +109,8 @@ func (c *realRecyclerClient) WatchPod(name, namespace, resourceVersion string, s
|
||||
|
||||
podLW := &cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return c.client.Pods(namespace).List(labels.Everything(), fieldSelector, unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{fieldSelector}}
|
||||
return c.client.Pods(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
options.FieldSelector.Selector = fieldSelector
|
||||
|
@ -29,8 +29,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
utilerrors "k8s.io/kubernetes/pkg/util/errors"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@ -101,7 +99,7 @@ func (l *limitRanger) Admit(a admission.Attributes) (err error) {
|
||||
func NewLimitRanger(client client.Interface, limitFunc LimitFunc) admission.Interface {
|
||||
lw := &cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return client.LimitRanges(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return client.LimitRanges(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return client.LimitRanges(api.NamespaceAll).Watch(options)
|
||||
|
@ -26,8 +26,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
@ -86,7 +84,7 @@ func NewProvision(c client.Interface) admission.Interface {
|
||||
reflector := cache.NewReflector(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return c.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return c.Namespaces().List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return c.Namespaces().Watch(options)
|
||||
|
@ -27,8 +27,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
@ -93,7 +91,7 @@ func NewExists(c client.Interface) admission.Interface {
|
||||
reflector := cache.NewReflector(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return c.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return c.Namespaces().List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return c.Namespaces().Watch(options)
|
||||
|
@ -28,8 +28,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@ -110,7 +108,7 @@ func NewLifecycle(c client.Interface) admission.Interface {
|
||||
reflector := cache.NewReflector(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return c.Namespaces().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return c.Namespaces().List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return c.Namespaces().Watch(options)
|
||||
|
@ -29,8 +29,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
resourcequotacontroller "k8s.io/kubernetes/pkg/controller/resourcequota"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
utilerrors "k8s.io/kubernetes/pkg/util/errors"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@ -52,7 +50,7 @@ type quota struct {
|
||||
func NewResourceQuota(client client.Interface) admission.Interface {
|
||||
lw := &cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return client.ResourceQuotas(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return client.ResourceQuotas(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return client.ResourceQuotas(api.NamespaceAll).Watch(options)
|
||||
|
@ -31,7 +31,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/controller/serviceaccount"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
kubelet "k8s.io/kubernetes/pkg/kubelet/types"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
@ -84,7 +83,7 @@ func NewServiceAccount(cl client.Interface) *serviceAccount {
|
||||
serviceAccountsIndexer, serviceAccountsReflector := cache.NewNamespaceKeyedIndexerAndReflector(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return cl.ServiceAccounts(api.NamespaceAll).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return cl.ServiceAccounts(api.NamespaceAll).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return cl.ServiceAccounts(api.NamespaceAll).Watch(options)
|
||||
@ -98,7 +97,8 @@ func NewServiceAccount(cl client.Interface) *serviceAccount {
|
||||
secretsIndexer, secretsReflector := cache.NewNamespaceKeyedIndexerAndReflector(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return cl.Secrets(api.NamespaceAll).List(labels.Everything(), tokenSelector, unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{tokenSelector}}
|
||||
return cl.Secrets(api.NamespaceAll).List(options)
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
options.FieldSelector.Selector = tokenSelector
|
||||
|
@ -22,8 +22,6 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
)
|
||||
@ -50,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodeList, err := c.Nodes().List(unversioned.ListOptions{})
|
||||
expectNoError(err)
|
||||
var errors []error
|
||||
retries := maxRetries
|
||||
|
@ -23,8 +23,6 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
@ -44,7 +42,7 @@ var _ = Describe("[Autoscaling] [Skipped]", func() {
|
||||
BeforeEach(func() {
|
||||
SkipUnlessProviderIs("gce")
|
||||
|
||||
nodes, err := f.Client.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodes, err := f.Client.Nodes().List(unversioned.ListOptions{})
|
||||
expectNoError(err)
|
||||
nodeCount = len(nodes.Items)
|
||||
Expect(nodeCount).NotTo(BeZero())
|
||||
|
@ -413,7 +413,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
rcs, err := f.Client.ReplicationControllers(f.Namespace.Name).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("error listing RCs: %v", err)
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
controllerframework "k8s.io/kubernetes/pkg/controller/framework"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/master/ports"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
@ -171,7 +170,8 @@ 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) {
|
||||
pods, err := c.Pods(ns).List(labelSelector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}}
|
||||
pods, err := c.Pods(ns).List(options)
|
||||
expectNoError(err)
|
||||
failedContainers := 0
|
||||
containerRestartNodes := sets.NewString()
|
||||
@ -221,7 +221,8 @@ var _ = Describe("DaemonRestart", func() {
|
||||
newPods, controller = controllerframework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return framework.Client.Pods(ns).List(labelSelector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{labelSelector}}
|
||||
return framework.Client.Pods(ns).List(options)
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
options.LabelSelector.Selector = labelSelector
|
||||
|
@ -27,7 +27,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/kubectl"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util/wait"
|
||||
@ -114,7 +113,9 @@ var _ = Describe("Daemon set", func() {
|
||||
By("Stop a daemon pod, check that the daemon pod is revived.")
|
||||
podClient := c.Pods(ns)
|
||||
|
||||
podList, err := podClient.List(labels.Set(label).AsSelector(), fields.Everything(), unversioned.ListOptions{})
|
||||
selector := labels.Set(label).AsSelector()
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
podList, err := podClient.List(options)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(len(podList.Items)).To(BeNumerically(">", 0))
|
||||
pod := podList.Items[0]
|
||||
@ -160,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodeList, err := nodeClient.List(unversioned.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")
|
||||
@ -196,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodeList, err := nodeClient.List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -251,7 +252,9 @@ 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) {
|
||||
podList, err := f.Client.Pods(f.Namespace.Name).List(labels.Set(selector).AsSelector(), fields.Everything(), unversioned.ListOptions{})
|
||||
selector := labels.Set(selector).AsSelector()
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
podList, err := f.Client.Pods(f.Namespace.Name).List(options)
|
||||
if err != nil {
|
||||
return false, nil
|
||||
}
|
||||
@ -279,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodeList, err := f.Client.Nodes().List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return false, nil
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ var _ = Describe("Density [Skipped]", func() {
|
||||
ns = framework.Namespace.Name
|
||||
var err error
|
||||
|
||||
nodes, err := c.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodes, err := c.Nodes().List(unversioned.ListOptions{})
|
||||
expectNoError(err)
|
||||
nodeCount = len(nodes.Items)
|
||||
Expect(nodeCount).NotTo(BeZero())
|
||||
@ -234,7 +234,7 @@ var _ = Describe("Density [Skipped]", func() {
|
||||
_, controller := controllerframework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return c.Events(ns).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
return c.Events(ns).List(unversioned.ListOptions{})
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
return c.Events(ns).Watch(options)
|
||||
@ -317,7 +317,9 @@ var _ = Describe("Density [Skipped]", func() {
|
||||
_, controller := controllerframework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func() (runtime.Object, error) {
|
||||
return c.Pods(ns).List(labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix}), fields.Everything(), unversioned.ListOptions{})
|
||||
selector := labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
return c.Pods(ns).List(options)
|
||||
},
|
||||
WatchFunc: func(options unversioned.ListOptions) (watch.Interface, error) {
|
||||
options.LabelSelector.Selector = labels.SelectorFromSet(labels.Set{"name": additionalPodsPrefix})
|
||||
@ -364,14 +366,13 @@ var _ = Describe("Density [Skipped]", func() {
|
||||
}
|
||||
close(stopCh)
|
||||
|
||||
schedEvents, err := c.Events(ns).List(
|
||||
labels.Everything(),
|
||||
fields.Set{
|
||||
"involvedObject.kind": "Pod",
|
||||
"involvedObject.namespace": ns,
|
||||
"source": "scheduler",
|
||||
}.AsSelector(),
|
||||
unversioned.ListOptions{})
|
||||
selector := fields.Set{
|
||||
"involvedObject.kind": "Pod",
|
||||
"involvedObject.namespace": ns,
|
||||
"source": "scheduler",
|
||||
}.AsSelector()
|
||||
options := unversioned.ListOptions{FieldSelector: unversioned.FieldSelector{selector}}
|
||||
schedEvents, err := c.Events(ns).List(options)
|
||||
expectNoError(err)
|
||||
for k := range createTimes {
|
||||
for _, event := range schedEvents.Items {
|
||||
|
@ -25,7 +25,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api/latest"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
client "k8s.io/kubernetes/pkg/client/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/wait"
|
||||
@ -191,7 +190,8 @@ var _ = Describe("DNS", func() {
|
||||
|
||||
systemClient := f.Client.Pods(api.NamespaceSystem)
|
||||
By("Waiting for DNS Service to be Running")
|
||||
dnsPods, err := systemClient.List(dnsServiceLableSelector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{dnsServiceLableSelector}}
|
||||
dnsPods, err := systemClient.List(options)
|
||||
if err != nil {
|
||||
Failf("Failed to list all dns service pods")
|
||||
}
|
||||
@ -229,7 +229,8 @@ var _ = Describe("DNS", func() {
|
||||
systemClient := f.Client.Pods(api.NamespaceSystem)
|
||||
|
||||
By("Waiting for DNS Service to be Running")
|
||||
dnsPods, err := systemClient.List(dnsServiceLableSelector, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{dnsServiceLableSelector}}
|
||||
dnsPods, err := systemClient.List(options)
|
||||
if err != nil {
|
||||
Failf("Failed to list all dns service pods")
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
@ -86,7 +85,8 @@ 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}))
|
||||
pods, err := f.Client.Pods(api.NamespaceSystem).List(label, fields.Everything(), unversioned.ListOptions{})
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{label}}
|
||||
pods, err := f.Client.Pods(api.NamespaceSystem).List(options)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
for _, pod := range pods.Items {
|
||||
err = waitForPodRunningInNamespace(f.Client, pod.Name, api.NamespaceSystem)
|
||||
@ -172,7 +172,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(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodes, err := f.Client.Nodes().List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
Failf("Failed to list nodes: %v", err)
|
||||
}
|
||||
@ -258,7 +258,9 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
|
||||
for start := time.Now(); time.Since(start) < ingestionTimeout; time.Sleep(10 * time.Second) {
|
||||
|
||||
// Debugging code to report the status of the elasticsearch logging endpoints.
|
||||
esPods, err := f.Client.Pods(api.NamespaceSystem).List(labels.Set{esKey: esValue}.AsSelector(), fields.Everything(), unversioned.ListOptions{})
|
||||
selector := labels.Set{esKey: esValue}.AsSelector()
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.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)
|
||||
continue
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user