@@ -5,10 +5,6 @@ import (
5
5
"strings"
6
6
"time"
7
7
8
- "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
9
- "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/certs"
10
- "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install"
11
- "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil"
12
8
log "github.com/sirupsen/logrus"
13
9
appsv1 "k8s.io/api/apps/v1"
14
10
corev1 "k8s.io/api/core/v1"
@@ -17,6 +13,11 @@ import (
17
13
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
18
14
"k8s.io/apimachinery/pkg/util/intstr"
19
15
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
16
+
17
+ "github.com/operator-framework/operator-lifecycle-manager/pkg/api/apis/operators/v1alpha1"
18
+ "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/certs"
19
+ "github.com/operator-framework/operator-lifecycle-manager/pkg/controller/install"
20
+ "github.com/operator-framework/operator-lifecycle-manager/pkg/lib/ownerutil"
20
21
)
21
22
22
23
const (
@@ -129,6 +130,9 @@ func (a *Operator) checkAPIServiceResources(csv *v1alpha1.ClusterServiceVersion,
129
130
130
131
// Ensure the Deployment's ServiceAccount exists
131
132
serviceAccountName := deployment .Spec .Template .Spec .ServiceAccountName
133
+ if serviceAccountName == "" {
134
+ serviceAccountName = "default"
135
+ }
132
136
serviceAccount , err := a .lister .CoreV1 ().ServiceAccountLister ().ServiceAccounts (deployment .GetNamespace ()).Get (serviceAccountName )
133
137
if err != nil {
134
138
logger .WithField ("serviceaccount" , serviceAccountName ).Warnf ("could not retrieve ServiceAccount" )
@@ -425,6 +429,10 @@ func (a *Operator) installAPIServiceRequirements(desc v1alpha1.APIServiceDescrip
425
429
return nil , err
426
430
}
427
431
432
+ if depSpec .Template .Spec .ServiceAccountName == "" {
433
+ depSpec .Template .Spec .ServiceAccountName = "default"
434
+ }
435
+
428
436
secretRoleBinding := & rbacv1.RoleBinding {
429
437
Subjects : []rbacv1.Subject {
430
438
{
0 commit comments