Simplify List() signature in clients.

This commit is contained in:
Wojciech Tyczynski
2015-12-02 12:12:57 +01:00
parent 800012dfb8
commit 6dcb689d4e
141 changed files with 532 additions and 650 deletions

View File

@@ -27,7 +27,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"
@@ -463,7 +462,9 @@ func prepareResourceWithReplacedString(inputFile, old, new string) string {
func forEachPod(c *client.Client, ns, selectorKey, selectorValue string, fn func(api.Pod)) {
pods := []*api.Pod{}
for t := time.Now(); time.Since(t) < podListTimeout; time.Sleep(poll) {
podList, err := c.Pods(ns).List(labels.SelectorFromSet(labels.Set(map[string]string{selectorKey: selectorValue})), fields.Everything(), unversioned.ListOptions{})
selector := labels.SelectorFromSet(labels.Set(map[string]string{selectorKey: selectorValue}))
options := unversioned.ListOptions{LabelSelector: unversioned.LabelSelector{selector}}
podList, err := c.Pods(ns).List(options)
Expect(err).NotTo(HaveOccurred())
for _, pod := range podList.Items {
if pod.Status.Phase == api.PodPending || pod.Status.Phase == api.PodRunning {