Validate endpoints are ready in e2e tests

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-07-21 09:14:59 -04:00
parent 268f7c5c4b
commit a4ec5c8a88

View file

@ -443,9 +443,14 @@ var _ = framework.DescribeAnnotation("auth-*", func() {
err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, framework.HTTPBinService, f.Namespace, 1) err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, framework.HTTPBinService, f.Namespace, 1)
assert.Nil(ginkgo.GinkgoT(), err) assert.Nil(ginkgo.GinkgoT(), err)
framework.Sleep(1)
e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get(context.TODO(), framework.HTTPBinService, metav1.GetOptions{}) e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get(context.TODO(), framework.HTTPBinService, metav1.GetOptions{})
assert.Nil(ginkgo.GinkgoT(), err) assert.Nil(ginkgo.GinkgoT(), err)
assert.GreaterOrEqual(ginkgo.GinkgoT(), len(e.Subsets), 1, "expected at least one endpoint")
assert.GreaterOrEqual(ginkgo.GinkgoT(), len(e.Subsets[0].Addresses), 1, "expected at least one address ready in the endpoint")
httpbinIP = e.Subsets[0].Addresses[0].IP httpbinIP = e.Subsets[0].Addresses[0].IP
annotations := map[string]string{ annotations := map[string]string{