mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Simplify List() signature in clients.
This commit is contained in:
@@ -25,7 +25,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"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
@@ -78,7 +77,9 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
|
||||
// situation when a heapster-monitoring-v1 and heapster-monitoring-v2 replication controller
|
||||
// is running (which would be an error except during a rolling update).
|
||||
for _, rcLabel := range rcLabels {
|
||||
rcList, err := c.ReplicationControllers(api.NamespaceSystem).List(labels.Set{"k8s-app": rcLabel}.AsSelector(), fields.Everything(), unversioned.ListOptions{})
|
||||
selector := labels.Set{"k8s-app": rcLabel}.AsSelector()
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
rcList, err := c.ReplicationControllers(api.NamespaceSystem).List(options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -87,7 +88,9 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
|
||||
rcLabel, len(rcList.Items))
|
||||
}
|
||||
for _, rc := range rcList.Items {
|
||||
podList, err := c.Pods(api.NamespaceSystem).List(labels.Set(rc.Spec.Selector).AsSelector(), fields.Everything(), unversioned.ListOptions{})
|
||||
selector := labels.Set(rc.Spec.Selector).AsSelector()
|
||||
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
|
||||
podList, err := c.Pods(api.NamespaceSystem).List(options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -103,7 +106,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
|
||||
}
|
||||
|
||||
func expectedServicesExist(c *client.Client) error {
|
||||
serviceList, err := c.Services(api.NamespaceSystem).List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
serviceList, err := c.Services(api.NamespaceSystem).List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -121,7 +124,7 @@ func expectedServicesExist(c *client.Client) error {
|
||||
}
|
||||
|
||||
func getAllNodesInCluster(c *client.Client) ([]string, error) {
|
||||
nodeList, err := c.Nodes().List(labels.Everything(), fields.Everything(), unversioned.ListOptions{})
|
||||
nodeList, err := c.Nodes().List(unversioned.ListOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user