mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Call jig.SanityCheckService automatically after changes
This commit is contained in:
parent
85ebedd93e
commit
4dcc6229b1
@ -851,7 +851,6 @@ func (cont *NginxIngressController) Init() {
|
||||
{Name: "stats", Port: 18080}}
|
||||
})
|
||||
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)))
|
||||
|
@ -15,7 +15,6 @@ go_library(
|
||||
importpath = "k8s.io/kubernetes/test/e2e/framework/service",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//pkg/registry/core/service/portallocator:go_default_library",
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/api/policy/v1beta1:go_default_library",
|
||||
|
@ -40,7 +40,6 @@ import (
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
api "k8s.io/kubernetes/pkg/apis/core"
|
||||
"k8s.io/kubernetes/pkg/registry/core/service/portallocator"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
|
||||
@ -106,6 +105,7 @@ func (j *TestJig) CreateTCPServiceWithPort(namespace string, tweak func(svc *v1.
|
||||
if err != nil {
|
||||
framework.Failf("Failed to create TCP Service %q: %v", svc.Name, err)
|
||||
}
|
||||
j.sanityCheckService(result, svc.Spec.Type)
|
||||
return result
|
||||
}
|
||||
|
||||
@ -121,6 +121,7 @@ func (j *TestJig) CreateTCPServiceOrFail(namespace string, tweak func(svc *v1.Se
|
||||
if err != nil {
|
||||
framework.Failf("Failed to create TCP Service %q: %v", svc.Name, err)
|
||||
}
|
||||
j.sanityCheckService(result, svc.Spec.Type)
|
||||
return result
|
||||
}
|
||||
|
||||
@ -136,6 +137,7 @@ func (j *TestJig) CreateUDPServiceOrFail(namespace string, tweak func(svc *v1.Se
|
||||
if err != nil {
|
||||
framework.Failf("Failed to create UDP Service %q: %v", svc.Name, err)
|
||||
}
|
||||
j.sanityCheckService(result, svc.Spec.Type)
|
||||
return result
|
||||
}
|
||||
|
||||
@ -161,6 +163,7 @@ func (j *TestJig) CreateExternalNameServiceOrFail(namespace string, tweak func(s
|
||||
if err != nil {
|
||||
framework.Failf("Failed to create ExternalName Service %q: %v", svc.Name, err)
|
||||
}
|
||||
j.sanityCheckService(result, svc.Spec.Type)
|
||||
return result
|
||||
}
|
||||
|
||||
@ -197,7 +200,6 @@ func (j *TestJig) CreateOnlyLocalNodePortService(namespace, serviceName string,
|
||||
ginkgo.By("creating a pod to be part of the service " + serviceName)
|
||||
j.RunOrFail(namespace, nil)
|
||||
}
|
||||
j.SanityCheckService(svc, v1.ServiceTypeNodePort)
|
||||
return svc
|
||||
}
|
||||
|
||||
@ -207,11 +209,8 @@ func (j *TestJig) CreateOnlyLocalNodePortService(namespace, serviceName string,
|
||||
// the standard netexec container used everywhere in this test.
|
||||
func (j *TestJig) CreateOnlyLocalLoadBalancerService(namespace, serviceName string, timeout time.Duration, createPod bool,
|
||||
tweak func(svc *v1.Service)) *v1.Service {
|
||||
ginkgo.By("creating a service " + namespace + "/" + serviceName + " with type=LoadBalancer and ExternalTrafficPolicy=Local")
|
||||
j.CreateTCPServiceOrFail(namespace, func(svc *v1.Service) {
|
||||
svc.Spec.Type = v1.ServiceTypeLoadBalancer
|
||||
// We need to turn affinity off for our LB distribution tests
|
||||
svc.Spec.SessionAffinity = v1.ServiceAffinityNone
|
||||
j.CreateLoadBalancerService(namespace, serviceName, timeout, func(svc *v1.Service) {
|
||||
ginkgo.By("setting ExternalTrafficPolicy=Local")
|
||||
svc.Spec.ExternalTrafficPolicy = v1.ServiceExternalTrafficPolicyTypeLocal
|
||||
if tweak != nil {
|
||||
tweak(svc)
|
||||
@ -223,28 +222,27 @@ func (j *TestJig) CreateOnlyLocalLoadBalancerService(namespace, serviceName stri
|
||||
j.RunOrFail(namespace, nil)
|
||||
}
|
||||
ginkgo.By("waiting for loadbalancer for service " + namespace + "/" + serviceName)
|
||||
svc := j.WaitForLoadBalancerOrFail(namespace, serviceName, timeout)
|
||||
j.SanityCheckService(svc, v1.ServiceTypeLoadBalancer)
|
||||
return svc
|
||||
return j.WaitForLoadBalancerOrFail(namespace, serviceName, timeout)
|
||||
}
|
||||
|
||||
// CreateLoadBalancerService creates a loadbalancer service and waits
|
||||
// for it to acquire an ingress IP.
|
||||
func (j *TestJig) CreateLoadBalancerService(namespace, serviceName string, timeout time.Duration, tweak func(svc *v1.Service)) *v1.Service {
|
||||
ginkgo.By("creating a service " + namespace + "/" + serviceName + " with type=LoadBalancer")
|
||||
j.CreateTCPServiceOrFail(namespace, func(svc *v1.Service) {
|
||||
svc.Spec.Type = v1.ServiceTypeLoadBalancer
|
||||
// We need to turn affinity off for our LB distribution tests
|
||||
svc.Spec.SessionAffinity = v1.ServiceAffinityNone
|
||||
if tweak != nil {
|
||||
tweak(svc)
|
||||
}
|
||||
})
|
||||
svc := j.newServiceTemplate(namespace, v1.ProtocolTCP, 80)
|
||||
svc.Spec.Type = v1.ServiceTypeLoadBalancer
|
||||
// We need to turn affinity off for our LB distribution tests
|
||||
svc.Spec.SessionAffinity = v1.ServiceAffinityNone
|
||||
if tweak != nil {
|
||||
tweak(svc)
|
||||
}
|
||||
_, err := j.Client.CoreV1().Services(namespace).Create(svc)
|
||||
if err != nil {
|
||||
framework.Failf("Failed to create LoadBalancer Service %q: %v", svc.Name, err)
|
||||
}
|
||||
|
||||
ginkgo.By("waiting for loadbalancer for service " + namespace + "/" + serviceName)
|
||||
svc := j.WaitForLoadBalancerOrFail(namespace, serviceName, timeout)
|
||||
j.SanityCheckService(svc, v1.ServiceTypeLoadBalancer)
|
||||
return svc
|
||||
return j.WaitForLoadBalancerOrFail(namespace, serviceName, timeout)
|
||||
}
|
||||
|
||||
// GetEndpointNodes returns a map of nodenames:external-ip on which the
|
||||
@ -361,8 +359,12 @@ func (j *TestJig) WaitForAvailableEndpoint(namespace, serviceName string, timeou
|
||||
framework.ExpectNoError(err, "No subset of available IP address found for the endpoint %s within timeout %v", serviceName, timeout)
|
||||
}
|
||||
|
||||
// SanityCheckService performs sanity checks on the given service
|
||||
func (j *TestJig) SanityCheckService(svc *v1.Service, svcType v1.ServiceType) {
|
||||
// sanityCheckService performs sanity checks on the given service; in particular, ensuring
|
||||
// that creating/updating a service allocates IPs, ports, etc, as needed.
|
||||
func (j *TestJig) sanityCheckService(svc *v1.Service, svcType v1.ServiceType) {
|
||||
if svcType == "" {
|
||||
svcType = v1.ServiceTypeClusterIP
|
||||
}
|
||||
if svc.Spec.Type != svcType {
|
||||
framework.Failf("unexpected Spec.Type (%s) for service, expected %s", svc.Spec.Type, svcType)
|
||||
}
|
||||
@ -371,12 +373,12 @@ func (j *TestJig) SanityCheckService(svc *v1.Service, svcType v1.ServiceType) {
|
||||
if svc.Spec.ExternalName != "" {
|
||||
framework.Failf("unexpected Spec.ExternalName (%s) for service, expected empty", svc.Spec.ExternalName)
|
||||
}
|
||||
if svc.Spec.ClusterIP != api.ClusterIPNone && svc.Spec.ClusterIP == "" {
|
||||
framework.Failf("didn't get ClusterIP for non-ExternamName service")
|
||||
if svc.Spec.ClusterIP == "" {
|
||||
framework.Failf("didn't get ClusterIP for non-ExternalName service")
|
||||
}
|
||||
} else {
|
||||
if svc.Spec.ClusterIP != "" {
|
||||
framework.Failf("unexpected Spec.ClusterIP (%s) for ExternamName service, expected empty", svc.Spec.ClusterIP)
|
||||
framework.Failf("unexpected Spec.ClusterIP (%s) for ExternalName service, expected empty", svc.Spec.ClusterIP)
|
||||
}
|
||||
}
|
||||
|
||||
@ -422,9 +424,10 @@ func (j *TestJig) UpdateService(namespace, name string, update func(*v1.Service)
|
||||
return nil, fmt.Errorf("failed to get Service %q: %v", name, err)
|
||||
}
|
||||
update(service)
|
||||
service, err = j.Client.CoreV1().Services(namespace).Update(service)
|
||||
result, err := j.Client.CoreV1().Services(namespace).Update(service)
|
||||
if err == nil {
|
||||
return service, nil
|
||||
j.sanityCheckService(result, service.Spec.Type)
|
||||
return result, nil
|
||||
}
|
||||
if !errors.IsConflict(err) && !errors.IsServerTimeout(err) {
|
||||
return nil, fmt.Errorf("failed to update Service %q: %v", name, err)
|
||||
@ -457,6 +460,7 @@ func (j *TestJig) WaitForNewIngressIPOrFail(namespace, name, existingIP string,
|
||||
}
|
||||
return true
|
||||
})
|
||||
j.sanityCheckService(service, v1.ServiceTypeLoadBalancer)
|
||||
return service
|
||||
}
|
||||
|
||||
@ -490,6 +494,7 @@ func (j *TestJig) WaitForLoadBalancerOrFail(namespace, name string, timeout time
|
||||
service := j.waitForConditionOrFail(namespace, name, timeout, "have a load balancer", func(svc *v1.Service) bool {
|
||||
return len(svc.Status.LoadBalancer.Ingress) > 0
|
||||
})
|
||||
j.sanityCheckService(service, v1.ServiceTypeLoadBalancer)
|
||||
return service
|
||||
}
|
||||
|
||||
@ -506,6 +511,7 @@ func (j *TestJig) WaitForLoadBalancerDestroyOrFail(namespace, name string, ip st
|
||||
service := j.waitForConditionOrFail(namespace, name, timeout, "have no load balancer", func(svc *v1.Service) bool {
|
||||
return len(svc.Status.LoadBalancer.Ingress) == 0
|
||||
})
|
||||
j.sanityCheckService(service, v1.ServiceTypeLoadBalancer)
|
||||
return service
|
||||
}
|
||||
|
||||
@ -838,7 +844,7 @@ func (j *TestJig) checkExternalServiceReachability(svc *v1.Service, pod *v1.Pod)
|
||||
func (j *TestJig) CheckServiceReachability(namespace string, svc *v1.Service, pod *v1.Pod) {
|
||||
svcType := svc.Spec.Type
|
||||
|
||||
j.SanityCheckService(svc, svcType)
|
||||
j.sanityCheckService(svc, svcType)
|
||||
|
||||
switch svcType {
|
||||
case v1.ServiceTypeClusterIP:
|
||||
|
@ -154,7 +154,6 @@ func waitAndVerifyLBWithTier(jig *e2eservice.TestJig, ns, svcName, existingIP st
|
||||
// Verify that the new ingress IP is the requested IP if it's set.
|
||||
framework.ExpectEqual(ingressIP, svc.Spec.LoadBalancerIP)
|
||||
}
|
||||
jig.SanityCheckService(svc, v1.ServiceTypeLoadBalancer)
|
||||
// If the IP has been used by previous test, sometimes we get the lingering
|
||||
// 404 errors even after the LB is long gone. Tolerate and retry until the
|
||||
// the new LB is fully established since this feature is still Alpha in GCP.
|
||||
|
@ -274,7 +274,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
jig := e2eservice.NewTestJig(cs, serviceName)
|
||||
servicePort := 8080
|
||||
tcpService := jig.CreateTCPServiceWithPort(ns, nil, int32(servicePort))
|
||||
jig.SanityCheckService(tcpService, v1.ServiceTypeClusterIP)
|
||||
defer func() {
|
||||
framework.Logf("Cleaning up the sourceip test service")
|
||||
err := cs.CoreV1().Services(ns).Delete(serviceName, nil)
|
||||
@ -345,7 +344,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
jig := e2eservice.NewTestJig(cs, serviceName)
|
||||
servicePort := 8080
|
||||
svc := jig.CreateTCPServiceWithPort(ns, nil, int32(servicePort))
|
||||
jig.SanityCheckService(svc, v1.ServiceTypeClusterIP)
|
||||
serviceIP := svc.Spec.ClusterIP
|
||||
framework.Logf("hairpin-test cluster ip: %s", serviceIP)
|
||||
|
||||
@ -589,11 +587,9 @@ var _ = SIGDescribe("Services", func() {
|
||||
|
||||
ginkgo.By("creating a TCP service " + serviceName + " with type=ClusterIP in namespace " + ns1)
|
||||
tcpService := jig.CreateTCPServiceOrFail(ns1, nil)
|
||||
jig.SanityCheckService(tcpService, v1.ServiceTypeClusterIP)
|
||||
|
||||
ginkgo.By("creating a UDP service " + serviceName + " with type=ClusterIP in namespace " + ns2)
|
||||
udpService := jig.CreateUDPServiceOrFail(ns2, nil)
|
||||
jig.SanityCheckService(udpService, v1.ServiceTypeClusterIP)
|
||||
|
||||
ginkgo.By("verifying that TCP and UDP use the same port")
|
||||
if tcpService.Spec.Ports[0].Port != udpService.Spec.Ports[0].Port {
|
||||
@ -614,7 +610,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
tcpService = jig.UpdateServiceOrFail(ns1, tcpService.Name, func(s *v1.Service) {
|
||||
s.Spec.Type = v1.ServiceTypeNodePort
|
||||
})
|
||||
jig.SanityCheckService(tcpService, v1.ServiceTypeNodePort)
|
||||
tcpNodePort := int(tcpService.Spec.Ports[0].NodePort)
|
||||
framework.Logf("TCP node port: %d", tcpNodePort)
|
||||
|
||||
@ -622,7 +617,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
udpService = jig.UpdateServiceOrFail(ns2, udpService.Name, func(s *v1.Service) {
|
||||
s.Spec.Type = v1.ServiceTypeNodePort
|
||||
})
|
||||
jig.SanityCheckService(udpService, v1.ServiceTypeNodePort)
|
||||
udpNodePort := int(udpService.Spec.Ports[0].NodePort)
|
||||
framework.Logf("UDP node port: %d", udpNodePort)
|
||||
|
||||
@ -681,7 +675,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
ginkgo.By("waiting for the TCP service to have a load balancer")
|
||||
// Wait for the load balancer to be created asynchronously
|
||||
tcpService = jig.WaitForLoadBalancerOrFail(ns1, tcpService.Name, loadBalancerCreateTimeout)
|
||||
jig.SanityCheckService(tcpService, v1.ServiceTypeLoadBalancer)
|
||||
if int(tcpService.Spec.Ports[0].NodePort) != tcpNodePort {
|
||||
framework.Failf("TCP Spec.Ports[0].NodePort changed (%d -> %d) when not expected", tcpNodePort, tcpService.Spec.Ports[0].NodePort)
|
||||
}
|
||||
@ -714,7 +707,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
ginkgo.By("waiting for the UDP service to have a load balancer")
|
||||
// 2nd one should be faster since they ran in parallel.
|
||||
udpService = jig.WaitForLoadBalancerOrFail(ns2, udpService.Name, loadBalancerCreateTimeout)
|
||||
jig.SanityCheckService(udpService, v1.ServiceTypeLoadBalancer)
|
||||
if int(udpService.Spec.Ports[0].NodePort) != udpNodePort {
|
||||
framework.Failf("UDP Spec.Ports[0].NodePort changed (%d -> %d) when not expected", udpNodePort, udpService.Spec.Ports[0].NodePort)
|
||||
}
|
||||
@ -745,7 +737,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
|
||||
ginkgo.By("changing the TCP service's NodePort")
|
||||
tcpService = jig.ChangeServiceNodePortOrFail(ns1, tcpService.Name, tcpNodePort)
|
||||
jig.SanityCheckService(tcpService, v1.ServiceTypeLoadBalancer)
|
||||
tcpNodePortOld := tcpNodePort
|
||||
tcpNodePort = int(tcpService.Spec.Ports[0].NodePort)
|
||||
if tcpNodePort == tcpNodePortOld {
|
||||
@ -758,11 +749,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
|
||||
ginkgo.By("changing the UDP service's NodePort")
|
||||
udpService = jig.ChangeServiceNodePortOrFail(ns2, udpService.Name, udpNodePort)
|
||||
if loadBalancerSupportsUDP {
|
||||
jig.SanityCheckService(udpService, v1.ServiceTypeLoadBalancer)
|
||||
} else {
|
||||
jig.SanityCheckService(udpService, v1.ServiceTypeNodePort)
|
||||
}
|
||||
udpNodePortOld := udpNodePort
|
||||
udpNodePort = int(udpService.Spec.Ports[0].NodePort)
|
||||
if udpNodePort == udpNodePortOld {
|
||||
@ -799,7 +785,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
tcpService = jig.UpdateServiceOrFail(ns1, tcpService.Name, func(s *v1.Service) {
|
||||
s.Spec.Ports[0].Port++
|
||||
})
|
||||
jig.SanityCheckService(tcpService, v1.ServiceTypeLoadBalancer)
|
||||
svcPortOld := svcPort
|
||||
svcPort = int(tcpService.Spec.Ports[0].Port)
|
||||
if svcPort == svcPortOld {
|
||||
@ -816,11 +801,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
udpService = jig.UpdateServiceOrFail(ns2, udpService.Name, func(s *v1.Service) {
|
||||
s.Spec.Ports[0].Port++
|
||||
})
|
||||
if loadBalancerSupportsUDP {
|
||||
jig.SanityCheckService(udpService, v1.ServiceTypeLoadBalancer)
|
||||
} else {
|
||||
jig.SanityCheckService(udpService, v1.ServiceTypeNodePort)
|
||||
}
|
||||
if int(udpService.Spec.Ports[0].Port) != svcPort {
|
||||
framework.Failf("UDP Spec.Ports[0].Port (%d) did not change", udpService.Spec.Ports[0].Port)
|
||||
}
|
||||
@ -892,7 +872,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
})
|
||||
// Wait for the load balancer to be destroyed asynchronously
|
||||
tcpService = jig.WaitForLoadBalancerDestroyOrFail(ns1, tcpService.Name, tcpIngressIP, svcPort, loadBalancerCreateTimeout)
|
||||
jig.SanityCheckService(tcpService, v1.ServiceTypeClusterIP)
|
||||
|
||||
ginkgo.By("changing UDP service back to type=ClusterIP")
|
||||
udpService = jig.UpdateServiceOrFail(ns2, udpService.Name, func(s *v1.Service) {
|
||||
@ -902,7 +881,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
if loadBalancerSupportsUDP {
|
||||
// Wait for the load balancer to be destroyed asynchronously
|
||||
udpService = jig.WaitForLoadBalancerDestroyOrFail(ns2, udpService.Name, udpIngressIP, svcPort, loadBalancerCreateTimeout)
|
||||
jig.SanityCheckService(udpService, v1.ServiceTypeClusterIP)
|
||||
}
|
||||
|
||||
ginkgo.By("checking the TCP NodePort is closed")
|
||||
@ -939,7 +917,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
err := cs.CoreV1().Services(ns).Delete(serviceName, nil)
|
||||
framework.ExpectNoError(err, "failed to delete service: %s in namespace: %s", serviceName, ns)
|
||||
}()
|
||||
jig.SanityCheckService(tcpService, v1.ServiceTypeClusterIP)
|
||||
framework.Logf("Service Port TCP: %v", tcpService.Spec.Ports[0].Port)
|
||||
|
||||
ginkgo.By("changing the TCP service to type=NodePort")
|
||||
@ -1006,7 +983,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
err := cs.CoreV1().Services(ns).Delete(serviceName, nil)
|
||||
framework.ExpectNoError(err, "failed to delete service %s in namespace %s", serviceName, ns)
|
||||
}()
|
||||
jig.SanityCheckService(externalNameService, v1.ServiceTypeExternalName)
|
||||
|
||||
ginkgo.By("changing the ExternalName service to type=ClusterIP")
|
||||
clusterIPService := jig.UpdateServiceOrFail(ns, externalNameService.Name, func(s *v1.Service) {
|
||||
@ -1042,7 +1018,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
err := cs.CoreV1().Services(ns).Delete(serviceName, nil)
|
||||
framework.ExpectNoError(err, "failed to delete service %s in namespace %s", serviceName, ns)
|
||||
}()
|
||||
jig.SanityCheckService(externalNameService, v1.ServiceTypeExternalName)
|
||||
|
||||
ginkgo.By("changing the ExternalName service to type=NodePort")
|
||||
nodePortService := jig.UpdateServiceOrFail(ns, externalNameService.Name, func(s *v1.Service) {
|
||||
@ -1077,7 +1052,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
err := cs.CoreV1().Services(ns).Delete(serviceName, nil)
|
||||
framework.ExpectNoError(err, "failed to delete service %s in namespace %s", serviceName, ns)
|
||||
}()
|
||||
jig.SanityCheckService(clusterIPService, v1.ServiceTypeClusterIP)
|
||||
|
||||
ginkgo.By("Creating active service to test reachability when its FQDN is referred as externalName for another service")
|
||||
externalServiceName := "externalsvc"
|
||||
@ -1117,7 +1091,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
err := cs.CoreV1().Services(ns).Delete(serviceName, nil)
|
||||
framework.ExpectNoError(err, "failed to delete service %s in namespace %s", serviceName, ns)
|
||||
}()
|
||||
jig.SanityCheckService(nodePortService, v1.ServiceTypeNodePort)
|
||||
|
||||
ginkgo.By("Creating active service to test reachability when its FQDN is referred as externalName for another service")
|
||||
externalServiceName := "externalsvc"
|
||||
@ -1515,7 +1488,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
}()
|
||||
|
||||
svc = jig.WaitForLoadBalancerOrFail(namespace, serviceName, loadBalancerCreateTimeout)
|
||||
jig.SanityCheckService(svc, v1.ServiceTypeLoadBalancer)
|
||||
|
||||
// timeout when we haven't just created the load balancer
|
||||
normalReachabilityTimeout := 2 * time.Minute
|
||||
@ -1589,7 +1561,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
}()
|
||||
|
||||
svc = jig.WaitForLoadBalancerOrFail(namespace, serviceName, createTimeout)
|
||||
jig.SanityCheckService(svc, v1.ServiceTypeLoadBalancer)
|
||||
lbIngress := &svc.Status.LoadBalancer.Ingress[0]
|
||||
svcPort := int(svc.Spec.Ports[0].Port)
|
||||
// should have an internal IP.
|
||||
@ -1638,7 +1609,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
framework.Failf("Loadbalancer IP not changed to external.")
|
||||
}
|
||||
// should have an external IP.
|
||||
jig.SanityCheckService(svc, v1.ServiceTypeLoadBalancer)
|
||||
gomega.Expect(isInternalEndpoint(lbIngress)).To(gomega.BeFalse())
|
||||
|
||||
ginkgo.By("hitting the external load balancer")
|
||||
@ -1667,7 +1637,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
framework.Failf("Loadbalancer IP not changed to internal.")
|
||||
}
|
||||
// should have the given static internal IP.
|
||||
jig.SanityCheckService(svc, v1.ServiceTypeLoadBalancer)
|
||||
framework.ExpectEqual(e2eservice.GetIngressPoint(lbIngress), internalStaticIP)
|
||||
}
|
||||
})
|
||||
@ -2466,7 +2435,6 @@ func execAffinityTestForLBServiceWithOptionalTransition(f *framework.Framework,
|
||||
jig := e2eservice.NewTestJig(cs, serviceName)
|
||||
ginkgo.By("waiting for loadbalancer for service " + ns + "/" + serviceName)
|
||||
svc = jig.WaitForLoadBalancerOrFail(ns, serviceName, e2eservice.LoadBalancerCreateTimeoutDefault)
|
||||
jig.SanityCheckService(svc, v1.ServiceTypeLoadBalancer)
|
||||
defer func() {
|
||||
podNodePairs, err := e2enode.PodNodePairs(cs, ns)
|
||||
framework.Logf("[pod,node] pairs: %+v; err: %v", podNodePairs, err)
|
||||
|
@ -52,7 +52,6 @@ func (t *ServiceUpgradeTest) Setup(f *framework.Framework) {
|
||||
s.Spec.Type = v1.ServiceTypeLoadBalancer
|
||||
})
|
||||
tcpService = jig.WaitForLoadBalancerOrFail(ns.Name, tcpService.Name, e2eservice.LoadBalancerCreateTimeoutDefault)
|
||||
jig.SanityCheckService(tcpService, v1.ServiceTypeLoadBalancer)
|
||||
|
||||
// Get info to hit it with
|
||||
tcpIngressIP := e2eservice.GetIngressPoint(&tcpService.Status.LoadBalancer.Ingress[0])
|
||||
@ -111,11 +110,9 @@ func (t *ServiceUpgradeTest) test(f *framework.Framework, done <-chan struct{},
|
||||
<-done
|
||||
}
|
||||
|
||||
// Sanity check and hit it once more
|
||||
// Hit it once more
|
||||
ginkgo.By("hitting the pod through the service's LoadBalancer")
|
||||
e2eservice.TestReachableHTTP(t.tcpIngressIP, t.svcPort, e2eservice.LoadBalancerLagTimeoutDefault)
|
||||
t.jig.SanityCheckService(t.tcpService, v1.ServiceTypeLoadBalancer)
|
||||
|
||||
if testFinalizer {
|
||||
defer func() {
|
||||
ginkgo.By("Check that service can be deleted with finalizer")
|
||||
|
@ -54,7 +54,6 @@ var _ = SIGDescribe("Services", func() {
|
||||
e2eservice := jig.CreateTCPServiceOrFail(ns, func(svc *v1.Service) {
|
||||
svc.Spec.Type = v1.ServiceTypeNodePort
|
||||
})
|
||||
jig.SanityCheckService(e2eservice, v1.ServiceTypeNodePort)
|
||||
nodePort := int(e2eservice.Spec.Ports[0].NodePort)
|
||||
|
||||
ginkgo.By("creating Pod to be part of service " + serviceName)
|
||||
|
Loading…
Reference in New Issue
Block a user