@@ -53,7 +53,7 @@ const (
53
53
var localStorageVersion = utilversion .MustParseSemantic ("v1.8.0-beta.0" )
54
54
55
55
// variable set in BeforeEach, never modified afterwards
56
- var masterNodes sets.String
56
+ var workerNodes sets.String
57
57
58
58
type pausePodConfig struct {
59
59
Name string
@@ -95,17 +95,14 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
95
95
96
96
framework .AllNodesReady (cs , time .Minute )
97
97
98
- // NOTE: Here doesn't get nodeList for supporting a master nodes which can host workload pods.
99
- masterNodes , _ , err = e2enode .GetMasterAndWorkerNodes (cs )
100
- if err != nil {
101
- framework .Logf ("Unexpected error occurred: %v" , err )
102
- }
103
98
nodeList , err = e2enode .GetReadySchedulableNodes (cs )
104
99
if err != nil {
105
100
framework .Logf ("Unexpected error occurred: %v" , err )
106
101
}
107
-
108
102
framework .ExpectNoErrorWithOffset (0 , err )
103
+ for _ , n := range nodeList .Items {
104
+ workerNodes .Insert (n .Name )
105
+ }
109
106
110
107
err = framework .CheckTestingNSDeletedExcept (cs , ns )
111
108
framework .ExpectNoError (err )
@@ -135,7 +132,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
135
132
nodeMaxAllocatable = allocatable .Value ()
136
133
}
137
134
}
138
- WaitForStableCluster (cs , masterNodes )
135
+ WaitForStableCluster (cs , workerNodes )
139
136
140
137
pods , err := cs .CoreV1 ().Pods (metav1 .NamespaceAll ).List (context .TODO (), metav1.ListOptions {})
141
138
framework .ExpectNoError (err )
@@ -215,7 +212,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
215
212
var beardsecond v1.ResourceName = "example.com/beardsecond"
216
213
217
214
ginkgo .BeforeEach (func () {
218
- WaitForStableCluster (cs , masterNodes )
215
+ WaitForStableCluster (cs , workerNodes )
219
216
ginkgo .By ("Add RuntimeClass and fake resource" )
220
217
221
218
// find a node which can run a pod:
@@ -323,7 +320,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
323
320
Description: Scheduling Pods MUST fail if the resource requests exceed Machine capacity.
324
321
*/
325
322
framework .ConformanceIt ("validates resource limits of pods that are allowed to run " , func () {
326
- WaitForStableCluster (cs , masterNodes )
323
+ WaitForStableCluster (cs , workerNodes )
327
324
nodeMaxAllocatable := int64 (0 )
328
325
nodeToAllocatableMap := make (map [string ]int64 )
329
326
for _ , node := range nodeList .Items {
@@ -436,7 +433,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
436
433
ginkgo .By ("Trying to schedule Pod with nonempty NodeSelector." )
437
434
podName := "restricted-pod"
438
435
439
- WaitForStableCluster (cs , masterNodes )
436
+ WaitForStableCluster (cs , workerNodes )
440
437
441
438
conf := pausePodConfig {
442
439
Name : podName ,
@@ -491,7 +488,7 @@ var _ = SIGDescribe("SchedulerPredicates [Serial]", func() {
491
488
ginkgo .By ("Trying to schedule Pod with nonempty NodeSelector." )
492
489
podName := "restricted-pod"
493
490
494
- WaitForStableCluster (cs , masterNodes )
491
+ WaitForStableCluster (cs , workerNodes )
495
492
496
493
conf := pausePodConfig {
497
494
Name : podName ,
@@ -933,7 +930,7 @@ func WaitForSchedulerAfterAction(f *framework.Framework, action Action, ns, podN
933
930
func verifyResult (c clientset.Interface , expectedScheduled int , expectedNotScheduled int , ns string ) {
934
931
allPods , err := c .CoreV1 ().Pods (ns ).List (context .TODO (), metav1.ListOptions {})
935
932
framework .ExpectNoError (err )
936
- scheduledPods , notScheduledPods := GetPodsScheduled (masterNodes , allPods )
933
+ scheduledPods , notScheduledPods := GetPodsScheduled (workerNodes , allPods )
937
934
938
935
framework .ExpectEqual (len (notScheduledPods ), expectedNotScheduled , fmt .Sprintf ("Not scheduled Pods: %#v" , notScheduledPods ))
939
936
framework .ExpectEqual (len (scheduledPods ), expectedScheduled , fmt .Sprintf ("Scheduled Pods: %#v" , scheduledPods ))
@@ -1045,10 +1042,10 @@ func translateIPv4ToIPv6(ip string) string {
1045
1042
return ip
1046
1043
}
1047
1044
1048
- // GetPodsScheduled returns a number of currently scheduled and not scheduled Pods.
1049
- func GetPodsScheduled (masterNodes sets.String , pods * v1.PodList ) (scheduledPods , notScheduledPods []v1.Pod ) {
1045
+ // GetPodsScheduled returns a number of currently scheduled and not scheduled Pods on worker nodes .
1046
+ func GetPodsScheduled (workerNodes sets.String , pods * v1.PodList ) (scheduledPods , notScheduledPods []v1.Pod ) {
1050
1047
for _ , pod := range pods .Items {
1051
- if ! masterNodes .Has (pod .Spec .NodeName ) {
1048
+ if workerNodes .Has (pod .Spec .NodeName ) {
1052
1049
if pod .Spec .NodeName != "" {
1053
1050
_ , scheduledCondition := podutil .GetPodCondition (& pod .Status , v1 .PodScheduled )
1054
1051
framework .ExpectEqual (scheduledCondition != nil , true )
0 commit comments