Merge pull request #86856 from ii/create-test-for-finding-service-from-listing-all-namespaces

Create test for finding service from listing all namespaces
This commit is contained in:
Kubernetes Prow Robot 2020-01-08 06:33:40 -08:00 committed by GitHub
commit 6c677b52a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2634,6 +2634,21 @@ var _ = SIGDescribe("Services", func() {
framework.ExpectNoError(err)
e2eservice.WaitForServiceUpdatedWithFinalizer(cs, svc.Namespace, svc.Name, true)
})
ginkgo.It("should find a service from listing all namespaces", func() {
ginkgo.By("fetching services")
svcs, _ := f.ClientSet.CoreV1().Services("").List(metav1.ListOptions{})
foundSvc := false
for _, svc := range svcs.Items {
if svc.ObjectMeta.Name == "kubernetes" && svc.ObjectMeta.Namespace == "default" {
foundSvc = true
break
}
}
framework.ExpectEqual(foundSvc, true, "could not find service 'kubernetes' in service list in all namespaces")
})
})
// TODO: Get rid of [DisabledForLargeClusters] tag when issue #56138 is fixed.