@@ -56,6 +56,9 @@ func TestClusterExtensionNonExistentPackage(t *testing.T) {
5656 Spec : ocv1alpha1.ClusterExtensionSpec {
5757 PackageName : pkgName ,
5858 InstallNamespace : "default" ,
59+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
60+ Name : "default" ,
61+ },
5962 },
6063 }
6164 require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -98,6 +101,9 @@ func TestClusterExtensionNonExistentVersion(t *testing.T) {
98101 PackageName : pkgName ,
99102 Version : "0.50.0" , // this version of the package does not exist
100103 InstallNamespace : "default" ,
104+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
105+ Name : "default" ,
106+ },
101107 },
102108 }
103109 require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -147,6 +153,7 @@ func TestClusterExtensionChannelVersionExists(t *testing.T) {
147153 pkgVer := "1.0.0"
148154 pkgChan := "beta"
149155 installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
156+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
150157
151158 clusterExtension := & ocv1alpha1.ClusterExtension {
152159 ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -155,6 +162,9 @@ func TestClusterExtensionChannelVersionExists(t *testing.T) {
155162 Version : pkgVer ,
156163 Channel : pkgChan ,
157164 InstallNamespace : installNamespace ,
165+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
166+ Name : serviceAccount ,
167+ },
158168 },
159169 }
160170 err := cl .Create (ctx , clusterExtension )
@@ -206,13 +216,18 @@ func TestClusterExtensionChannelExistsNoVersion(t *testing.T) {
206216 pkgVer := ""
207217 pkgChan := "beta"
208218 installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
219+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
220+
209221 clusterExtension := & ocv1alpha1.ClusterExtension {
210222 ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
211223 Spec : ocv1alpha1.ClusterExtensionSpec {
212224 PackageName : pkgName ,
213225 Version : pkgVer ,
214226 Channel : pkgChan ,
215227 InstallNamespace : installNamespace ,
228+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
229+ Name : serviceAccount ,
230+ },
216231 },
217232 }
218233 err := cl .Create (ctx , clusterExtension )
@@ -265,6 +280,9 @@ func TestClusterExtensionVersionNoChannel(t *testing.T) {
265280 Version : pkgVer ,
266281 Channel : pkgChan ,
267282 InstallNamespace : "default" ,
283+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
284+ Name : "default" ,
285+ },
268286 },
269287 }
270288 require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -313,6 +331,9 @@ func TestClusterExtensionNoChannel(t *testing.T) {
313331 PackageName : pkgName ,
314332 Channel : pkgChan ,
315333 InstallNamespace : "default" ,
334+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
335+ Name : "default" ,
336+ },
316337 },
317338 }
318339 require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -363,6 +384,9 @@ func TestClusterExtensionNoVersion(t *testing.T) {
363384 Version : pkgVer ,
364385 Channel : pkgChan ,
365386 InstallNamespace : "default" ,
387+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
388+ Name : "default" ,
389+ },
366390 },
367391 }
368392 require .NoError (t , cl .Create (ctx , clusterExtension ))
@@ -443,6 +467,7 @@ func TestClusterExtensionUpgrade(t *testing.T) {
443467 pkgVer := "1.0.0"
444468 pkgChan := "beta"
445469 installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
470+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
446471 extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
447472 clusterExtension := & ocv1alpha1.ClusterExtension {
448473 ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -451,6 +476,9 @@ func TestClusterExtensionUpgrade(t *testing.T) {
451476 Version : pkgVer ,
452477 Channel : pkgChan ,
453478 InstallNamespace : installNamespace ,
479+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
480+ Name : serviceAccount ,
481+ },
454482 },
455483 }
456484 // Create a cluster extension
@@ -543,6 +571,7 @@ func TestClusterExtensionUpgrade(t *testing.T) {
543571 pkgVer := "1.0.0"
544572 pkgChan := "beta"
545573 installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
574+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
546575 extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
547576 clusterExtension := & ocv1alpha1.ClusterExtension {
548577 ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -551,6 +580,9 @@ func TestClusterExtensionUpgrade(t *testing.T) {
551580 Version : pkgVer ,
552581 Channel : pkgChan ,
553582 InstallNamespace : installNamespace ,
583+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
584+ Name : serviceAccount ,
585+ },
554586 },
555587 }
556588 // Create a cluster extension
@@ -654,6 +686,7 @@ func TestClusterExtensionUpgrade(t *testing.T) {
654686 }()
655687
656688 installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
689+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
657690 extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
658691 clusterExtension := & ocv1alpha1.ClusterExtension {
659692 ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -663,6 +696,9 @@ func TestClusterExtensionUpgrade(t *testing.T) {
663696 Channel : "beta" ,
664697 UpgradeConstraintPolicy : ocv1alpha1 .UpgradeConstraintPolicyIgnore ,
665698 InstallNamespace : installNamespace ,
699+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
700+ Name : serviceAccount ,
701+ },
666702 },
667703 }
668704 // Create a cluster extension
@@ -754,6 +790,7 @@ func TestClusterExtensionDowngrade(t *testing.T) {
754790 }()
755791
756792 installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
793+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
757794 extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
758795 clusterExtension := & ocv1alpha1.ClusterExtension {
759796 ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -762,6 +799,9 @@ func TestClusterExtensionDowngrade(t *testing.T) {
762799 Version : "1.0.1" ,
763800 Channel : "beta" ,
764801 InstallNamespace : installNamespace ,
802+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
803+ Name : serviceAccount ,
804+ },
765805 },
766806 }
767807 // Create a cluster extension
@@ -842,6 +882,7 @@ func TestClusterExtensionDowngrade(t *testing.T) {
842882 }()
843883
844884 installNamespace := fmt .Sprintf ("test-ns-%s" , rand .String (8 ))
885+ serviceAccount := fmt .Sprintf ("test-sa-%s" , rand .String (8 ))
845886 extKey := types.NamespacedName {Name : fmt .Sprintf ("cluster-extension-test-%s" , rand .String (8 ))}
846887 clusterExtension := & ocv1alpha1.ClusterExtension {
847888 ObjectMeta : metav1.ObjectMeta {Name : extKey .Name },
@@ -851,6 +892,9 @@ func TestClusterExtensionDowngrade(t *testing.T) {
851892 Channel : "beta" ,
852893 UpgradeConstraintPolicy : ocv1alpha1 .UpgradeConstraintPolicyIgnore ,
853894 InstallNamespace : installNamespace ,
895+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
896+ Name : serviceAccount ,
897+ },
854898 },
855899 }
856900 // Create a cluster extension
@@ -1461,6 +1505,9 @@ func TestClusterExtensionErrorGettingBundles(t *testing.T) {
14611505 Spec : ocv1alpha1.ClusterExtensionSpec {
14621506 PackageName : "prometheus" ,
14631507 InstallNamespace : "default" ,
1508+ ServiceAccount : ocv1alpha1.ServiceAccountReference {
1509+ Name : "default" ,
1510+ },
14641511 },
14651512 }
14661513 require .NoError (t , cl .Create (ctx , clusterExtension ))
0 commit comments