Merge pull request #82696 from mm4tt/nginx_custom_lb_timeout

Adjust nginx lb timeout depending on the cluster size in tests
This commit is contained in:
Kubernetes Prow Robot 2019-09-16 20:28:23 -07:00 committed by GitHub
commit 1d724554f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -831,6 +831,7 @@ type NginxIngressController struct {
rc *v1.ReplicationController
pod *v1.Pod
Client clientset.Interface
lbSvc *v1.Service
}
// Init initializes the NginxIngressController
@ -848,8 +849,8 @@ func (cont *NginxIngressController) Init() {
{Name: "https", Port: 443},
{Name: "stats", Port: 18080}}
})
svc := serviceJig.WaitForLoadBalancerOrFail(cont.Ns, "nginx-ingress-lb", e2eservice.LoadBalancerCreateTimeoutDefault)
serviceJig.SanityCheckService(svc, v1.ServiceTypeLoadBalancer)
cont.lbSvc = serviceJig.WaitForLoadBalancerOrFail(cont.Ns, "nginx-ingress-lb", e2eservice.GetServiceLoadBalancerCreationTimeout(cont.Client))
serviceJig.SanityCheckService(cont.lbSvc, v1.ServiceTypeLoadBalancer)
read := func(file string) string {
return string(testfiles.ReadOrDie(filepath.Join(IngressManifestPath, "nginx", file)))
@ -873,6 +874,15 @@ func (cont *NginxIngressController) Init() {
framework.Logf("ingress controller running in pod %v", cont.pod.Name)
}
// TearDown cleans up the NginxIngressController.
func (cont *NginxIngressController) TearDown() {
if cont.lbSvc == nil {
framework.Logf("No LoadBalancer service created, no cleanup necessary")
return
}
e2eservice.WaitForServiceDeletedWithFinalizer(cont.Client, cont.Ns, cont.lbSvc.Name)
}
func generateBacksideHTTPSIngressSpec(ns string) *networkingv1beta1.Ingress {
return &networkingv1beta1.Ingress{
ObjectMeta: metav1.ObjectMeta{

View File

@ -737,6 +737,7 @@ var _ = SIGDescribe("Loadbalancing: L7", func() {
if ginkgo.CurrentGinkgoTestDescription().Failed {
framework.DescribeIng(ns)
}
defer nginxController.TearDown()
if jig.Ingress == nil {
ginkgo.By("No ingress created, no cleanup necessary")
return