Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e pod cleanup test: restrict pods to be assigned to nodes observed … #36780

Merged
merged 1 commit into from
Nov 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions test/e2e/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,20 @@ var _ = framework.KubeDescribe("kubelet", func() {

BeforeEach(func() {
c = f.ClientSet
// Use node labels to restrict the pods to be assigned only to the
// nodes we observe initially.
nodeLabels = make(map[string]string)
nodeLabels["kubelet_cleanup"] = "true"

nodes := framework.GetReadySchedulableNodesOrDie(c)
numNodes = len(nodes.Items)
nodeNames = sets.NewString()
// If there are a lot of nodes, we don't want to use all of them
// (if there are 1000 nodes in the cluster, starting 10 pods/node
// will take ~10 minutes today). And there is also deletion phase.
//
// Instead, we choose at most 10 nodes and will constraint pods
// that we are creating to be scheduled only on that nodes.
// Instead, we choose at most 10 nodes.
if numNodes > maxNodesToCheck {
numNodes = maxNodesToCheck
nodeLabels = make(map[string]string)
nodeLabels["kubelet_cleanup"] = "true"
}
for i := 0; i < numNodes; i++ {
nodeNames.Insert(nodes.Items[i].Name)
Expand Down