Change Kubelet test to run also in large clusters

This commit is contained in:
Wojciech Tyczynski
2016-06-01 08:18:26 +02:00
parent a1074e4381
commit 1afe14deaf
2 changed files with 81 additions and 10 deletions

View File

@@ -278,6 +278,9 @@ type RCConfig struct {
// Extra labels added to every pod.
Labels map[string]string
// Node selector for pods in the RC.
NodeSelector map[string]string
// Ports to declare in the container (map of name to containerPort).
Ports map[string]int
// Ports to declare in the container as host and container ports.
@@ -2232,6 +2235,12 @@ func (config *RCConfig) applyTo(template *api.PodTemplateSpec) {
template.ObjectMeta.Labels[k] = v
}
}
if config.NodeSelector != nil {
template.Spec.NodeSelector = make(map[string]string)
for k, v := range config.NodeSelector {
template.Spec.NodeSelector[k] = v
}
}
if config.Ports != nil {
for k, v := range config.Ports {
c := &template.Spec.Containers[0]