Skip to content

Commit 7f2129d

Browse files
authored
Merge pull request #593 from njhale/use-mock-ext
test(csv): use mock-ext-server for owned apiservice e2e test
2 parents ff0ea15 + 1cb4061 commit 7f2129d

File tree

6 files changed

+164
-143
lines changed

6 files changed

+164
-143
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ require (
7474
k8s.io/code-generator v0.0.0-20180904193909-8c97d6ab64da
7575
k8s.io/gengo v0.0.0-20181106084056-51747d6e00da // indirect
7676
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92 // indirect
77-
k8s.io/kube-aggregator v0.0.0-20180905000155-efa32eb095fe
77+
k8s.io/kube-aggregator v0.0.0-20181121072050-af204e4cff09
7878
k8s.io/kube-openapi v0.0.0-20181031203759-72693cb1fadd
7979
k8s.io/kubernetes v1.11.6-beta.0.0.20181126160157-5933b9771b71
8080
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92 h1:PgoMI/L1Nu5Vmvgm+vGheLuxKST8h6
228228
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
229229
k8s.io/kube-aggregator v0.0.0-20180905000155-efa32eb095fe h1:LM48rywzVEPRg+Os2oUL9/vsztPQGoxmiD3m5VySchw=
230230
k8s.io/kube-aggregator v0.0.0-20180905000155-efa32eb095fe/go.mod h1:8sbzT4QQKDEmSCIbfqjV0sd97GpUT7A4W626sBiYJmU=
231+
k8s.io/kube-aggregator v0.0.0-20181121072050-af204e4cff09 h1:v5wOckd8yeVJcWcnE0xLdW60/Qrd17gXxW24O3aiNxg=
232+
k8s.io/kube-aggregator v0.0.0-20181121072050-af204e4cff09/go.mod h1:8sbzT4QQKDEmSCIbfqjV0sd97GpUT7A4W626sBiYJmU=
231233
k8s.io/kube-openapi v0.0.0-20181031203759-72693cb1fadd h1:ggv/Vfza0i5xuhUZyYyxcc25AmQvHY8Zi1C2m8WgBvA=
232234
k8s.io/kube-openapi v0.0.0-20181031203759-72693cb1fadd/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc=
233235
k8s.io/kubernetes v1.11.6-beta.0.0.20181126160157-5933b9771b71 h1:ZiDzUVY+KNDO1sbcG0hHZokQsNIhjCCCsy06Z4Ck4JA=

pkg/controller/operators/olm/apiservices.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import (
55
"strings"
66
"time"
77

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"
128
log "github.com/sirupsen/logrus"
139
appsv1 "k8s.io/api/apps/v1"
1410
corev1 "k8s.io/api/core/v1"
@@ -17,6 +13,11 @@ import (
1713
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1814
"k8s.io/apimachinery/pkg/util/intstr"
1915
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"
2021
)
2122

2223
const (
@@ -129,6 +130,9 @@ func (a *Operator) checkAPIServiceResources(csv *v1alpha1.ClusterServiceVersion,
129130

130131
// Ensure the Deployment's ServiceAccount exists
131132
serviceAccountName := deployment.Spec.Template.Spec.ServiceAccountName
133+
if serviceAccountName == "" {
134+
serviceAccountName = "default"
135+
}
132136
serviceAccount, err := a.lister.CoreV1().ServiceAccountLister().ServiceAccounts(deployment.GetNamespace()).Get(serviceAccountName)
133137
if err != nil {
134138
logger.WithField("serviceaccount", serviceAccountName).Warnf("could not retrieve ServiceAccount")
@@ -425,6 +429,10 @@ func (a *Operator) installAPIServiceRequirements(desc v1alpha1.APIServiceDescrip
425429
return nil, err
426430
}
427431

432+
if depSpec.Template.Spec.ServiceAccountName == "" {
433+
depSpec.Template.Spec.ServiceAccountName = "default"
434+
}
435+
428436
secretRoleBinding := &rbacv1.RoleBinding{
429437
Subjects: []rbacv1.Subject{
430438
{

0 commit comments

Comments
 (0)