Retry fed-lb-svc creation on diff NodePort during e2e tests

Currently, in federated end2end tests, the creation of services are
done with a randomize NodePort selection. It causing e2e test
flakes if the creation of a federated service failed if the port is
not available.
Now the util.CreateService(...) function is re trying to create the
service on different nodePort in an error case. The method retries until
success or 10 creation retry with other random NodePorts.
If never the service has not been created properly on one of the
federated cluster, a Service shards cleanup is executed before retrying
again the federated service creation.

fixes #44018
This commit is contained in:
Cedric Lamoriniere
2017-08-08 21:30:53 +02:00
parent 02d04de81e
commit e033d8c6a0
3 changed files with 90 additions and 13 deletions

View File

@@ -163,7 +163,7 @@ var _ = framework.KubeDescribe("Federated ingresses [Feature:Federation]", func(
clusters = f.GetRegisteredClusters()
ns = f.FederationNamespace.Name
// create backend service
service = createLBServiceOrFail(f.FederationClientset, ns, FederatedIngressServiceName)
service = createLBServiceOrFail(f.FederationClientset, ns, FederatedIngressServiceName, clusters)
// create the TLS secret
secret = createTLSSecretOrFail(f.FederationClientset, ns, FederatedIngressTLSSecretName)
// wait for services objects sync