@@ -56,6 +56,9 @@ func TestClusterExtensionNonExistentPackage(t *testing.T) {
56
56
Spec : ocv1alpha1.ClusterExtensionSpec {
57
57
PackageName : pkgName ,
58
58
InstallNamespace : "default" ,
59
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
60
+ Name : "default" ,
61
+ },
59
62
},
60
63
}
61
64
require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -98,6 +101,9 @@ func TestClusterExtensionNonExistentVersion(t *testing.T) {
98
101
PackageName : pkgName ,
99
102
Version : "0.50.0" , // this version of the package does not exist
100
103
InstallNamespace : "default" ,
104
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
105
+ Name : "default" ,
106
+ },
101
107
},
102
108
}
103
109
require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -147,6 +153,7 @@ func TestClusterExtensionChannelVersionExists(t *testing.T) {
147
153
pkgVer := "1.0.0"
148
154
pkgChan := "beta"
149
155
installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
156
+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
150
157
151
158
clusterExtension := & ocv1alpha1.ClusterExtension {
152
159
ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -155,6 +162,9 @@ func TestClusterExtensionChannelVersionExists(t *testing.T) {
155
162
Version : pkgVer ,
156
163
Channel : pkgChan ,
157
164
InstallNamespace : installNamespace ,
165
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
166
+ Name : serviceAccount ,
167
+ },
158
168
},
159
169
}
160
170
err := cl .Create (ctx , clusterExtension )
@@ -206,13 +216,18 @@ func TestClusterExtensionChannelExistsNoVersion(t *testing.T) {
206
216
pkgVer := ""
207
217
pkgChan := "beta"
208
218
installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
219
+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
220
+
209
221
clusterExtension := & ocv1alpha1.ClusterExtension {
210
222
ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
211
223
Spec : ocv1alpha1.ClusterExtensionSpec {
212
224
PackageName : pkgName ,
213
225
Version : pkgVer ,
214
226
Channel : pkgChan ,
215
227
InstallNamespace : installNamespace ,
228
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
229
+ Name : serviceAccount ,
230
+ },
216
231
},
217
232
}
218
233
err := cl .Create (ctx , clusterExtension )
@@ -265,6 +280,9 @@ func TestClusterExtensionVersionNoChannel(t *testing.T) {
265
280
Version : pkgVer ,
266
281
Channel : pkgChan ,
267
282
InstallNamespace : "default" ,
283
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
284
+ Name : "default" ,
285
+ },
268
286
},
269
287
}
270
288
require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -313,6 +331,9 @@ func TestClusterExtensionNoChannel(t *testing.T) {
313
331
PackageName : pkgName ,
314
332
Channel : pkgChan ,
315
333
InstallNamespace : "default" ,
334
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
335
+ Name : "default" ,
336
+ },
316
337
},
317
338
}
318
339
require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -363,6 +384,9 @@ func TestClusterExtensionNoVersion(t *testing.T) {
363
384
Version : pkgVer ,
364
385
Channel : pkgChan ,
365
386
InstallNamespace : "default" ,
387
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
388
+ Name : "default" ,
389
+ },
366
390
},
367
391
}
368
392
require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -443,6 +467,7 @@ func TestClusterExtensionUpgrade(t *testing.T) {
443
467
pkgVer := "1.0.0"
444
468
pkgChan := "beta"
445
469
installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
470
+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
446
471
extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
447
472
clusterExtension := & ocv1alpha1.ClusterExtension {
448
473
ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -451,6 +476,9 @@ func TestClusterExtensionUpgrade(t *testing.T) {
451
476
Version : pkgVer ,
452
477
Channel : pkgChan ,
453
478
InstallNamespace : installNamespace ,
479
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
480
+ Name : serviceAccount ,
481
+ },
454
482
},
455
483
}
456
484
// Create a cluster extension
@@ -543,6 +571,7 @@ func TestClusterExtensionUpgrade(t *testing.T) {
543
571
pkgVer := "1.0.0"
544
572
pkgChan := "beta"
545
573
installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
574
+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
546
575
extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
547
576
clusterExtension := & ocv1alpha1.ClusterExtension {
548
577
ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -551,6 +580,9 @@ func TestClusterExtensionUpgrade(t *testing.T) {
551
580
Version : pkgVer ,
552
581
Channel : pkgChan ,
553
582
InstallNamespace : installNamespace ,
583
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
584
+ Name : serviceAccount ,
585
+ },
554
586
},
555
587
}
556
588
// Create a cluster extension
@@ -654,6 +686,7 @@ func TestClusterExtensionUpgrade(t *testing.T) {
654
686
}()
655
687
656
688
installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
689
+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
657
690
extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
658
691
clusterExtension := & ocv1alpha1.ClusterExtension {
659
692
ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -663,6 +696,9 @@ func TestClusterExtensionUpgrade(t *testing.T) {
663
696
Channel : "beta" ,
664
697
UpgradeConstraintPolicy : ocv1alpha1 .UpgradeConstraintPolicyIgnore ,
665
698
InstallNamespace : installNamespace ,
699
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
700
+ Name : serviceAccount ,
701
+ },
666
702
},
667
703
}
668
704
// Create a cluster extension
@@ -754,6 +790,7 @@ func TestClusterExtensionDowngrade(t *testing.T) {
754
790
}()
755
791
756
792
installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
793
+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
757
794
extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
758
795
clusterExtension := & ocv1alpha1.ClusterExtension {
759
796
ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -762,6 +799,9 @@ func TestClusterExtensionDowngrade(t *testing.T) {
762
799
Version : "1.0.1" ,
763
800
Channel : "beta" ,
764
801
InstallNamespace : installNamespace ,
802
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
803
+ Name : serviceAccount ,
804
+ },
765
805
},
766
806
}
767
807
// Create a cluster extension
@@ -842,6 +882,7 @@ func TestClusterExtensionDowngrade(t *testing.T) {
842
882
}()
843
883
844
884
installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
885
+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
845
886
extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
846
887
clusterExtension := & ocv1alpha1.ClusterExtension {
847
888
ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -851,6 +892,9 @@ func TestClusterExtensionDowngrade(t *testing.T) {
851
892
Channel : "beta" ,
852
893
UpgradeConstraintPolicy : ocv1alpha1 .UpgradeConstraintPolicyIgnore ,
853
894
InstallNamespace : installNamespace ,
895
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
896
+ Name : serviceAccount ,
897
+ },
854
898
},
855
899
}
856
900
// Create a cluster extension
@@ -1461,6 +1505,9 @@ func TestClusterExtensionErrorGettingBundles(t *testing.T) {
1461
1505
Spec : ocv1alpha1.ClusterExtensionSpec {
1462
1506
PackageName : "prometheus" ,
1463
1507
InstallNamespace : "default" ,
1508
+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
1509
+ Name : "default" ,
1510
+ },
1464
1511
},
1465
1512
}
1466
1513
require .NoError (t , cl .Create (ctx , clusterExtension ))
0 commit comments