Merge pull request #81419 from mgdevstack/checkServiceReachability

Update e2e testing nodePort service listening on same port but different protocols
This commit is contained in:
Kubernetes Prow Robot
2019-10-01 01:21:40 -07:00
committed by GitHub
2 changed files with 59 additions and 80 deletions

View File

@@ -859,7 +859,7 @@ func (j *TestJig) CheckServiceReachability(namespace string, svc *v1.Service, po
}
}
// CreateServicePods creates a replication controller with the label same as service
// CreateServicePods creates a replication controller with the label same as service. Service listens to HTTP.
func (j *TestJig) CreateServicePods(c clientset.Interface, ns string, replica int) {
config := testutils.RCConfig{
Client: c,
@@ -875,3 +875,20 @@ func (j *TestJig) CreateServicePods(c clientset.Interface, ns string, replica in
err := framework.RunRC(config)
framework.ExpectNoError(err, "Replica must be created")
}
// CreateTCPUDPServicePods creates a replication controller with the label same as service. Service listens to TCP and UDP.
func (j *TestJig) CreateTCPUDPServicePods(c clientset.Interface, ns string, replica int) {
config := testutils.RCConfig{
Client: c,
Name: j.Name,
Image: framework.ServeHostnameImage,
Command: []string{"/agnhost", "serve-hostname", "--http=false", "--tcp", "--udp"},
Namespace: ns,
Labels: j.Labels,
PollInterval: 3 * time.Second,
Timeout: framework.PodReadyBeforeTimeout,
Replicas: replica,
}
err := framework.RunRC(config)
framework.ExpectNoError(err, "Replica must be created")
}