@@ -132,7 +132,7 @@ func TestPodSchedulingOverrides(t *testing.T) {
132
132
expectedPriorityClassName string
133
133
}{
134
134
{
135
- title : "No overrides" ,
135
+ title : "no overrides" ,
136
136
catalogSource : & v1alpha1.CatalogSource {
137
137
ObjectMeta : metav1.ObjectMeta {
138
138
Name : "test" ,
@@ -147,7 +147,7 @@ func TestPodSchedulingOverrides(t *testing.T) {
147
147
expectedPriorityClassName : defaultPriorityClassName ,
148
148
expectedNodeSelectors : defaultNodeSelectors ,
149
149
}, {
150
- title : "Override node selectors" ,
150
+ title : "override node selectors" ,
151
151
catalogSource : & v1alpha1.CatalogSource {
152
152
ObjectMeta : metav1.ObjectMeta {
153
153
Name : "test" ,
@@ -165,7 +165,7 @@ func TestPodSchedulingOverrides(t *testing.T) {
165
165
expectedPriorityClassName : defaultPriorityClassName ,
166
166
expectedNodeSelectors : overriddenNodeSelectors ,
167
167
}, {
168
- title : "Override priority class name" ,
168
+ title : "override priority class name" ,
169
169
catalogSource : & v1alpha1.CatalogSource {
170
170
ObjectMeta : metav1.ObjectMeta {
171
171
Name : "test" ,
@@ -175,13 +175,31 @@ func TestPodSchedulingOverrides(t *testing.T) {
175
175
SourceType : v1alpha1 .SourceTypeGrpc ,
176
176
Image : "repo/image:tag" ,
177
177
GrpcPodConfig : & v1alpha1.GrpcPodConfig {
178
- PriorityClassName : overriddenPriorityClassName ,
178
+ PriorityClassName : & overriddenPriorityClassName ,
179
179
},
180
180
},
181
181
},
182
182
expectedTolerations : nil ,
183
183
expectedPriorityClassName : overriddenPriorityClassName ,
184
184
expectedNodeSelectors : defaultNodeSelectors ,
185
+ }, {
186
+ title : "doesn't override priority class name when its nil" ,
187
+ catalogSource : & v1alpha1.CatalogSource {
188
+ ObjectMeta : metav1.ObjectMeta {
189
+ Name : "test" ,
190
+ Namespace : "testns" ,
191
+ },
192
+ Spec : v1alpha1.CatalogSourceSpec {
193
+ SourceType : v1alpha1 .SourceTypeGrpc ,
194
+ Image : "repo/image:tag" ,
195
+ GrpcPodConfig : & v1alpha1.GrpcPodConfig {
196
+ PriorityClassName : nil ,
197
+ },
198
+ },
199
+ },
200
+ expectedTolerations : nil ,
201
+ expectedPriorityClassName : defaultPriorityClassName ,
202
+ expectedNodeSelectors : defaultNodeSelectors ,
185
203
}, {
186
204
title : "Override node tolerations" ,
187
205
catalogSource : & v1alpha1.CatalogSource {
@@ -212,7 +230,7 @@ func TestPodSchedulingOverrides(t *testing.T) {
212
230
Image : "repo/image:tag" ,
213
231
GrpcPodConfig : & v1alpha1.GrpcPodConfig {
214
232
NodeSelector : overriddenNodeSelectors ,
215
- PriorityClassName : overriddenPriorityClassName ,
233
+ PriorityClassName : & overriddenPriorityClassName ,
216
234
Tolerations : overriddenTolerations ,
217
235
},
218
236
},
0 commit comments