Add e2e multiple endpoint services test
- ensures that when multiple services with the same selector will function even if one of the services is deleted
This commit is contained in:
@@ -611,11 +611,11 @@ func (config *NetworkingTestConfig) createNodePortServiceSpec(svcName string, se
|
||||
}
|
||||
|
||||
func (config *NetworkingTestConfig) createNodePortService(selector map[string]string) {
|
||||
config.NodePortService = config.createService(config.createNodePortServiceSpec(nodePortServiceName, selector, false))
|
||||
config.NodePortService = config.CreateService(config.createNodePortServiceSpec(nodePortServiceName, selector, false))
|
||||
}
|
||||
|
||||
func (config *NetworkingTestConfig) createSessionAffinityService(selector map[string]string) {
|
||||
config.SessionAffinityService = config.createService(config.createNodePortServiceSpec(sessionAffinityServiceName, selector, true))
|
||||
config.SessionAffinityService = config.CreateService(config.createNodePortServiceSpec(sessionAffinityServiceName, selector, true))
|
||||
}
|
||||
|
||||
// DeleteNodePortService deletes NodePort service.
|
||||
@@ -651,7 +651,8 @@ func (config *NetworkingTestConfig) createTestPods() {
|
||||
}
|
||||
}
|
||||
|
||||
func (config *NetworkingTestConfig) createService(serviceSpec *v1.Service) *v1.Service {
|
||||
// CreateService creates the provided service in config.Namespace and returns created service
|
||||
func (config *NetworkingTestConfig) CreateService(serviceSpec *v1.Service) *v1.Service {
|
||||
_, err := config.getServiceClient().Create(context.TODO(), serviceSpec, metav1.CreateOptions{})
|
||||
framework.ExpectNoError(err, fmt.Sprintf("Failed to create %s service: %v", serviceSpec.Name, err))
|
||||
|
||||
|
Reference in New Issue
Block a user