Change:
framework.ExpectNoError(err, "failed to delete service: %s in namespace: %s", serviceName, ns) }() jig.SanityCheckService(tcpService, v1.ServiceTypeClusterIP) <del> svcPort := int(tcpService.Spec.Ports[0].Port) framework.Logf("service port TCP: %d", svcPort) </del> <ins> framework.Logf("Service Port TCP: %v", tcpService.Spec.Ports[0].Port) ginkgo.By("changing the TCP service to type=NodePort") nodePortService := jig.UpdateServiceOrFail(ns, tcpService.Name, func(s *v1.Service) { s.Spec.Type = v1.ServiceTypeNodePort s.Spec.Ports = []v1.ServicePort{ { Name:       "tcp-port", Port:       80, Protocol:   v1.ProtocolTCP, TargetPort: intstr.FromInt(9376), }, } }) jig.CreateTCPUDPServicePods(cs, ns, 2) execPod := e2epod.CreateExecPodOrFail(cs, ns, "execpod", nil) jig.CheckServiceReachability(ns, nodePortService, execPod) </ins> <del> // Change the services to NodePort and add a UDP port. ginkgo.By("changing the TCP service to type=NodePort and add a UDP port") newService := jig.UpdateServiceOrFail(ns, tcpService.Name, func(s *v1.Service) { </del> <ins> ginkgo.By("Updating NodePort service to listen TCP and UDP based requests over same Port") nodePortService = jig.UpdateServiceOrFail(ns, tcpService.Name, func(s *v1.Service) { </ins> s.Spec.Type = v1.ServiceTypeNodePort s.Spec.Ports = []v1.ServicePort{ { <del> Name:     "tcp-port", Port:     80, Protocol: v1.ProtocolTCP, </del> <ins> Name:       "tcp-port", Port:       80, Protocol:   v1.ProtocolTCP, TargetPort: intstr.FromInt(9376), </ins> }, { <del> Name:     "udp-port", Port:     80, Protocol: v1.ProtocolUDP, </del> <ins> Name:       "udp-port", Port:       80, Protocol:   v1.ProtocolUDP, TargetPort: intstr.FromInt(9376), </ins> }, } }) <del> jig.SanityCheckService(newService, v1.ServiceTypeNodePort) if len(newService.Spec.Ports) != 2 { framework.Failf("new service should have two Ports") } for _, port := range newService.Spec.Ports { if port.NodePort == 0 { framework.Failf("new service failed to allocate NodePort for Port %s", port.Name) } </del> <ins> jig.CheckServiceReachability(ns, nodePortService, execPod) nodePortCounts := len(nodePortService.Spec.Ports) framework.ExpectEqual(nodePortCounts, 2, "updated service should have two Ports but found %d Ports", nodePortCounts) </ins> <del> framework.Logf("new service allocates NodePort %d for Port %s", port.NodePort, port.Name) </del> <ins> for _, port := range nodePortService.Spec.Ports { framework.ExpectNotEqual(port.NodePort, 0, "NodePort service failed to allocate NodePort for Port %s", port.Name) framework.Logf("NodePort service allocates NodePort: %d for Port: %s over Protocol: %s", port.NodePort, port.Name, port.Protocol) </ins> } })

Discussion:
<!-- Please only use this template for submitting enhancement requests --What would you like to be : Following are two e2e testing service functioning over same port but different protocol, but do not test service reachability. be able to update NodePorts with two same port numbers but different protocols use same NodePort with same port but different protocols Note: Both the e2e are verifying the same behavior of "service using same port but different protocols" differs in and . Primary goal: Test service reachability for these E2Es. Secondary goal: As both the above e2e are verifying same E2E behavior, it's good to have single e2e in spite of 2 differing in "updating" and "create only" nodePort service. For "create only", suite has another specific e2e . Why is this needed: E2E Improvement and make e2e eligible for Conformance. Service related e2e are getting promoted in /area conformance /sig testing /assign