Merge pull request #1231 from canhnt/sticky-path-rewriter

Add tests to cover sticky cookie and rewrite-target annotations
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-11-23 20:08:04 -03:00 committed by GitHub
commit 82b4d2a0af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 198 additions and 15 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 {