Clenup tests

This commit is contained in:
Manuel de Brito Fontes 2018-01-23 20:37:47 -03:00 committed by Manuel Alejandro de Brito Fontes
parent 12ec0475c0
commit 62622f6516
3 changed files with 18 additions and 16 deletions

View file

@ -27,12 +27,14 @@ import (
restclient "k8s.io/client-go/rest"
"github.com/golang/glog"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
const (
podName = "test-ingress-controller"
podName = "test-ingress-controller"
controllerPodName = "nginx-ingress-controller"
)
const (
@ -225,12 +227,15 @@ func (f *Framework) matchNginxConditions(name string, matcher func(cfg string) b
}
var pod *v1.Pod
Loop:
for _, p := range l.Items {
if strings.HasPrefix(p.GetName(), "nginx-ingress-controller") &&
len(p.Status.ContainerStatuses) > 0 &&
p.Status.ContainerStatuses[0].State.Running != nil {
pod = &p
break
if strings.HasPrefix(p.GetName(), "nginx-ingress-controller") {
for _, cs := range p.Status.ContainerStatuses {
if cs.State.Running != nil && cs.Name == "nginx-ingress-controller" {
pod = &p
break Loop
}
}
}
}