Merge pull request #37538 from resouer/fix-e2e-respect-id

Automatic merge from submit-queue

CreateNodeSelectorPods should respect parameter

Fix (1): `CreateNodeSelectorPods` should respect parameter `id`.

The existing e2e does not break because it happened use "node-selector" as id, which  is the same as the hard coded value.

Fix (2): The current `CreateNodeSelectorPods` does not use `nodeSelector` parameter, it hard coded a label instead.

The reason current e2e does not influenced because we happened use the same label: https://github.com/kubernetes/kubernetes/blob/master/test/e2e/cluster_size_autoscaling.go#L177

Found these bugs during testing #36238
This commit is contained in:
Kubernetes Submit Queue 2016-12-27 04:43:46 -08:00 committed by GitHub
commit a1265e0864

View File

@ -495,13 +495,13 @@ func CreateNodeSelectorPods(f *framework.Framework, id string, replicas int, nod
config := &testutils.RCConfig{
Client: f.ClientSet,
InternalClient: f.InternalClientset,
Name: "node-selector",
Name: id,
Namespace: f.Namespace.Name,
Timeout: defaultTimeout,
Image: framework.GetPauseImageName(f.ClientSet),
Replicas: replicas,
HostPorts: map[string]int{"port1": 4321},
NodeSelector: map[string]string{"cluster-autoscaling-test.special-node": "true"},
NodeSelector: nodeSelector,
}
err := framework.RunRC(*config)
if expectRunning {