@@ -31,13 +31,15 @@ import (
31
31
resourceapi "k8s.io/api/resource/v1beta1"
32
32
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
33
33
"k8s.io/apimachinery/pkg/types"
34
+ "k8s.io/kubernetes/pkg/controller/daemon"
35
+
34
36
"k8s.io/autoscaler/cluster-autoscaler/config"
35
37
drautils "k8s.io/autoscaler/cluster-autoscaler/simulator/dynamicresources/utils"
36
38
"k8s.io/autoscaler/cluster-autoscaler/simulator/framework"
37
39
"k8s.io/autoscaler/cluster-autoscaler/utils/errors"
40
+ "k8s.io/autoscaler/cluster-autoscaler/utils/labels"
38
41
"k8s.io/autoscaler/cluster-autoscaler/utils/taints"
39
42
. "k8s.io/autoscaler/cluster-autoscaler/utils/test"
40
- "k8s.io/kubernetes/pkg/controller/daemon"
41
43
)
42
44
43
45
var (
69
71
},
70
72
},
71
73
}
72
- testDaemonSets = []* appsv1.DaemonSet {ds1 , ds2 , ds3 }
74
+ ds4 = & appsv1.DaemonSet {
75
+ ObjectMeta : metav1.ObjectMeta {
76
+ Name : "ds4" ,
77
+ Namespace : "ds4-namespace" ,
78
+ UID : types .UID ("ds4" ),
79
+ },
80
+ Spec : appsv1.DaemonSetSpec {
81
+ Template : apiv1.PodTemplateSpec {
82
+ Spec : apiv1.PodSpec {
83
+ PriorityClassName : labels .SystemNodeCriticalLabel ,
84
+ },
85
+ },
86
+ },
87
+ }
88
+ testDaemonSets = []* appsv1.DaemonSet {ds1 , ds2 , ds3 , ds4 }
73
89
)
74
90
75
91
func TestSanitizedTemplateNodeInfoFromNodeGroup (t * testing.T ) {
@@ -98,6 +114,7 @@ func TestSanitizedTemplateNodeInfoFromNodeGroup(t *testing.T) {
98
114
wantPods : []* apiv1.Pod {
99
115
buildDSPod (ds1 , "n" ),
100
116
buildDSPod (ds2 , "n" ),
117
+ buildDSPod (ds4 , "n" ),
101
118
},
102
119
},
103
120
{
@@ -116,6 +133,7 @@ func TestSanitizedTemplateNodeInfoFromNodeGroup(t *testing.T) {
116
133
SetMirrorPodSpec (BuildScheduledTestPod ("p3" , 100 , 1 , "n" )),
117
134
buildDSPod (ds1 , "n" ),
118
135
buildDSPod (ds2 , "n" ),
136
+ buildDSPod (ds4 , "n" ),
119
137
},
120
138
},
121
139
} {
@@ -208,6 +226,7 @@ func TestSanitizedTemplateNodeInfoFromNodeInfo(t *testing.T) {
208
226
daemonSets : testDaemonSets ,
209
227
wantPods : []* apiv1.Pod {
210
228
buildDSPod (ds1 , "n" ),
229
+ buildDSPod (ds4 , "n" ),
211
230
},
212
231
},
213
232
{
@@ -232,6 +251,7 @@ func TestSanitizedTemplateNodeInfoFromNodeInfo(t *testing.T) {
232
251
wantPods : []* apiv1.Pod {
233
252
buildDSPod (ds1 , "n" ),
234
253
buildDSPod (ds2 , "n" ),
254
+ buildDSPod (ds4 , "n" ),
235
255
},
236
256
},
237
257
{
@@ -248,6 +268,7 @@ func TestSanitizedTemplateNodeInfoFromNodeInfo(t *testing.T) {
248
268
wantPods : []* apiv1.Pod {
249
269
SetMirrorPodSpec (BuildScheduledTestPod ("p3" , 100 , 1 , "n" )),
250
270
buildDSPod (ds1 , "n" ),
271
+ buildDSPod (ds4 , "n" ),
251
272
},
252
273
},
253
274
{
@@ -266,6 +287,7 @@ func TestSanitizedTemplateNodeInfoFromNodeInfo(t *testing.T) {
266
287
SetMirrorPodSpec (BuildScheduledTestPod ("p3" , 100 , 1 , "n" )),
267
288
buildDSPod (ds1 , "n" ),
268
289
buildDSPod (ds2 , "n" ),
290
+ buildDSPod (ds4 , "n" ),
269
291
},
270
292
},
271
293
}
0 commit comments