Unify per-resource List for unversioned client

This commit is contained in:
Wojciech Tyczynski
2015-10-13 12:11:48 +02:00
parent dfb400e2e9
commit 647aa1bc8c
34 changed files with 73 additions and 67 deletions

View File

@@ -461,7 +461,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())
rcs, err := f.Client.ReplicationControllers(f.Namespace.Name).List(labels.Everything(), fields.Everything())
if err != nil {
return fmt.Errorf("error listing RCs: %v", err)
}

View File

@@ -882,7 +882,7 @@ func forEachReplicationController(c *client.Client, ns, selectorKey, selectorVal
var rcs *api.ReplicationControllerList
var err error
for t := time.Now(); time.Since(t) < podListTimeout; time.Sleep(poll) {
rcs, err = c.ReplicationControllers(ns).List(labels.SelectorFromSet(labels.Set(map[string]string{selectorKey: selectorValue})))
rcs, err = c.ReplicationControllers(ns).List(labels.SelectorFromSet(labels.Set(map[string]string{selectorKey: selectorValue})), fields.Everything())
Expect(err).NotTo(HaveOccurred())
if len(rcs.Items) > 0 {
break

View File

@@ -78,7 +78,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
// situaiton 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())
rcList, err := c.ReplicationControllers(api.NamespaceSystem).List(labels.Set{"k8s-app": rcLabel}.AsSelector(), fields.Everything())
if err != nil {
return nil, err
}
@@ -103,7 +103,7 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
}
func expectedServicesExist(c *client.Client) error {
serviceList, err := c.Services(api.NamespaceSystem).List(labels.Everything())
serviceList, err := c.Services(api.NamespaceSystem).List(labels.Everything(), fields.Everything())
if err != nil {
return err
}

View File

@@ -340,7 +340,7 @@ func waitForPodsRunningReady(ns string, minPods int, timeout time.Duration) erro
// We get the new list of pods and replication controllers in every
// iteration because more pods come online during startup and we want to
// ensure they are also checked.
rcList, err := c.ReplicationControllers(ns).List(labels.Everything())
rcList, err := c.ReplicationControllers(ns).List(labels.Everything(), fields.Everything())
if err != nil {
Logf("Error getting replication controllers in namespace '%s': %v", ns, err)
return false, nil