Skip to content

Commit

Permalink
Fix storage tests for multizone test configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
mborsz committed Aug 7, 2017
1 parent bc7ccfe commit 6d789ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/e2e/framework/volume_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ type VolumeTestConfig struct {
ServerNodeName string
// ClientNodeName is the spec.nodeName to run client pod on. Default is any node.
ClientNodeName string
// NodeSelector to use in pod spec (server, client and injector pods).
NodeSelector map[string]string
}

// VolumeTest contains a volume to mount into a client pod and its
Expand Down Expand Up @@ -286,6 +288,7 @@ func StartVolumeServer(client clientset.Interface, config VolumeTestConfig) *v1.
Volumes: volumes,
RestartPolicy: restartPolicy,
NodeName: config.ServerNodeName,
NodeSelector: config.NodeSelector,
},
}

Expand Down Expand Up @@ -390,8 +393,9 @@ func TestVolumeClient(client clientset.Interface, config VolumeTestConfig, fsGro
Level: "s0:c0,c1",
},
},
Volumes: []v1.Volume{},
NodeName: config.ClientNodeName,
Volumes: []v1.Volume{},
NodeName: config.ClientNodeName,
NodeSelector: config.NodeSelector,
},
}
podsNamespacer := client.CoreV1().Pods(config.Namespace)
Expand Down Expand Up @@ -476,6 +480,7 @@ func InjectHtml(client clientset.Interface, config VolumeTestConfig, volume v1.V
VolumeSource: volume,
},
},
NodeSelector: config.NodeSelector,
},
}

Expand Down
6 changes: 6 additions & 0 deletions test/e2e/storage/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import (
"k8s.io/apimachinery/pkg/types"
clientset "k8s.io/client-go/kubernetes"
"k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere"
kubeletapis "k8s.io/kubernetes/pkg/kubelet/apis"
"k8s.io/kubernetes/test/e2e/framework"
)

Expand Down Expand Up @@ -429,6 +430,11 @@ var _ = SIGDescribe("Volumes", func() {
config = framework.VolumeTestConfig{
Namespace: namespace.Name,
Prefix: "pd",
// PD will be created in framework.TestContext.CloudConfig.Zone zone,
// so pods should be also scheduled there.
NodeSelector: map[string]string{
kubeletapis.LabelZoneFailureDomain: framework.TestContext.CloudConfig.Zone,
},
}
})

Expand Down

0 comments on commit 6d789ee

Please sign in to comment.