Added e2e test for sticky cookie and redirection

This commit is contained in:
Canh Ngo 2017-11-22 00:00:19 +01:00
parent 363d3c1f4f
commit d37722b0c7
2 changed files with 161 additions and 3 deletions

View file

@ -29,15 +29,21 @@ import (
"k8s.io/apimachinery/pkg/util/intstr"
)
// NewEchoDeployment creates a new deployment of the echoserver image in a particular namespace
// NewEchoDeployment creates a new single replica deployment of the echoserver image in a particular namespace
func (f *Framework) NewEchoDeployment() error {
return f.NewEchoDeploymentWithReplicas(1)
}
// NewEchoDeploymentWithReplicas creates a new deployment of the echoserver image in a particular namespace. Number of
// replicas is configurable
func (f *Framework) NewEchoDeploymentWithReplicas(replicas int32) error {
deployment := &extensions.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "http-svc",
Namespace: f.Namespace.Name,
},
Spec: extensions.DeploymentSpec{
Replicas: NewInt32(1),
Replicas: NewInt32(replicas),
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"app": "http-svc",
@ -78,7 +84,7 @@ func (f *Framework) NewEchoDeployment() error {
return fmt.Errorf("unexpected error creating deployement for echoserver")
}
err = f.WaitForPodsReady(10*time.Second, 1, metav1.ListOptions{
err = f.WaitForPodsReady(10*time.Second, int(replicas), metav1.ListOptions{
LabelSelector: fields.SelectorFromSet(fields.Set(d.Spec.Template.ObjectMeta.Labels)).String(),
})
if err != nil {