Skip to content

Commit 1ec24c4

Browse files
committed
wip
1 parent 9c4f298 commit 1ec24c4

13 files changed

+97
-2
lines changed

staging/operator-lifecycle-manager/test/e2e/bundle_e2e_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ var _ = Describe("Installing bundles with new object types", func() {
102102
Spec: v1alpha1.CatalogSourceSpec{
103103
SourceType: v1alpha1.SourceTypeGrpc,
104104
Image: imageName,
105+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
106+
SecurityContextConfig: v1alpha1.Restricted,
107+
},
105108
},
106109
}
107110

staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
562562
Spec: v1alpha1.CatalogSourceSpec{
563563
SourceType: v1alpha1.SourceTypeGrpc,
564564
Address: net.JoinHostPort(mainCopy.Status.PodIP, "50051"),
565+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
566+
SecurityContextConfig: v1alpha1.Restricted,
567+
},
565568
},
566569
}
567570

@@ -702,6 +705,9 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
702705
Spec: v1alpha1.CatalogSourceSpec{
703706
SourceType: v1alpha1.SourceTypeGrpc,
704707
Image: communityOperatorsImage,
708+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
709+
SecurityContextConfig: v1alpha1.Restricted,
710+
},
705711
},
706712
}
707713

@@ -837,6 +843,9 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
837843
RawInterval: "1m0s",
838844
},
839845
},
846+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
847+
SecurityContextConfig: v1alpha1.Restricted,
848+
},
840849
},
841850
}
842851

@@ -1014,6 +1023,9 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
10141023
Spec: v1alpha1.CatalogSourceSpec{
10151024
SourceType: v1alpha1.SourceTypeGrpc,
10161025
Image: catSrcImage + ":1.0.0-with-ListBundles-method",
1026+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
1027+
SecurityContextConfig: v1alpha1.Restricted,
1028+
},
10171029
},
10181030
}
10191031

@@ -1122,6 +1134,9 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
11221134
RawInterval: "45s",
11231135
},
11241136
},
1137+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
1138+
SecurityContextConfig: v1alpha1.Restricted,
1139+
},
11251140
},
11261141
}
11271142

@@ -1200,6 +1215,9 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
12001215
RawInterval: incorrectInterval,
12011216
},
12021217
},
1218+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
1219+
SecurityContextConfig: v1alpha1.Restricted,
1220+
},
12031221
},
12041222
}
12051223

@@ -1274,6 +1292,9 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
12741292
Spec: v1alpha1.CatalogSourceSpec{
12751293
SourceType: v1alpha1.SourceTypeGrpc,
12761294
Image: "quay.io/olmtest/catsrc-update-test:old",
1295+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
1296+
SecurityContextConfig: v1alpha1.Restricted,
1297+
},
12771298
},
12781299
}
12791300

@@ -1511,11 +1532,11 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
15111532
Labels: map[string]string{"olm.catalogSource": sourceName},
15121533
},
15131534
Spec: v1alpha1.CatalogSourceSpec{
1535+
SourceType: v1alpha1.SourceTypeGrpc,
1536+
Image: "quay.io/olmtest/old-opm-catsrc:v1.21.0",
15141537
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
15151538
SecurityContextConfig: operatorsv1alpha1.Legacy,
15161539
},
1517-
SourceType: v1alpha1.SourceTypeGrpc,
1518-
Image: "quay.io/olmtest/old-opm-catsrc:v1.21.0",
15191540
},
15201541
}
15211542

staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ var _ = Describe("Global Catalog Exclusion", func() {
5555
DisplayName: "Broken Global Catalog Source",
5656
SourceType: v1alpha1.SourceTypeGrpc,
5757
Address: "1.1.1.1:1337", // points to non-existing service
58+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
59+
SecurityContextConfig: v1alpha1.Restricted,
60+
},
5861
},
5962
}
6063
_ = determinedE2eClient.Create(context.Background(), globalCatalog)

staging/operator-lifecycle-manager/test/e2e/catsrc_pod_config_e2e_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ var _ = Describe("CatalogSource Grpc Pod Config", func() {
5656
Spec: v1alpha1.CatalogSourceSpec{
5757
SourceType: v1alpha1.SourceTypeGrpc,
5858
Image: "repo/image:tag",
59+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
60+
SecurityContextConfig: v1alpha1.Restricted,
61+
},
5962
},
6063
}
6164
})

staging/operator-lifecycle-manager/test/e2e/dynamic_resource_e2e_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ var _ = Describe("Subscriptions create required objects from Catalogs", func() {
6868
Spec: v1alpha1.CatalogSourceSpec{
6969
Image: "quay.io/olmtest/catsrc_dynamic_resources:e2e-test",
7070
SourceType: v1alpha1.SourceTypeGrpc,
71+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
72+
SecurityContextConfig: v1alpha1.Restricted,
73+
},
7174
},
7275
}
7376

staging/operator-lifecycle-manager/test/e2e/gc_e2e_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ var _ = Describe("Garbage collection for dependent resources", func() {
350350
Spec: v1alpha1.CatalogSourceSpec{
351351
SourceType: v1alpha1.SourceTypeGrpc,
352352
Image: imageName,
353+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
354+
SecurityContextConfig: v1alpha1.Restricted,
355+
},
353356
},
354357
}
355358

@@ -470,6 +473,9 @@ var _ = Describe("Garbage collection for dependent resources", func() {
470473
Spec: v1alpha1.CatalogSourceSpec{
471474
SourceType: v1alpha1.SourceTypeGrpc,
472475
Image: imageName,
476+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
477+
SecurityContextConfig: v1alpha1.Restricted,
478+
},
473479
},
474480
}
475481

@@ -585,6 +591,9 @@ var _ = Describe("Garbage collection for dependent resources", func() {
585591
Spec: v1alpha1.CatalogSourceSpec{
586592
SourceType: v1alpha1.SourceTypeGrpc,
587593
Image: imageName,
594+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
595+
SecurityContextConfig: v1alpha1.Restricted,
596+
},
588597
},
589598
}
590599

staging/operator-lifecycle-manager/test/e2e/installplan_e2e_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3089,6 +3089,9 @@ var _ = Describe("Install Plan", func() {
30893089
Spec: operatorsv1alpha1.CatalogSourceSpec{
30903090
Image: "quay.io/operator-framework/ci-index:latest",
30913091
SourceType: operatorsv1alpha1.SourceTypeGrpc,
3092+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
3093+
SecurityContextConfig: operatorsv1alpha1.Restricted,
3094+
},
30923095
},
30933096
}
30943097
catsrc, err = crc.OperatorsV1alpha1().CatalogSources(catsrc.GetNamespace()).Create(context.Background(), catsrc, metav1.CreateOptions{})
@@ -3245,6 +3248,9 @@ var _ = Describe("Install Plan", func() {
32453248
Spec: operatorsv1alpha1.CatalogSourceSpec{
32463249
SourceType: operatorsv1alpha1.SourceTypeGrpc,
32473250
Address: dependentCatalogSource.Status.RegistryServiceStatus.Address(),
3251+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
3252+
SecurityContextConfig: operatorsv1alpha1.Restricted,
3253+
},
32483254
},
32493255
}
32503256
addressSource.SetName(genName("alt-dep-"))
@@ -3419,6 +3425,9 @@ var _ = Describe("Install Plan", func() {
34193425
Spec: operatorsv1alpha1.CatalogSourceSpec{
34203426
Image: "localhost:0/not/exist:catsrc",
34213427
SourceType: operatorsv1alpha1.SourceTypeGrpc,
3428+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
3429+
SecurityContextConfig: operatorsv1alpha1.Restricted,
3430+
},
34223431
},
34233432
}
34243433
Eventually(func() error {
@@ -3633,6 +3642,9 @@ var _ = Describe("Install Plan", func() {
36333642
Spec: operatorsv1alpha1.CatalogSourceSpec{
36343643
Image: "quay.io/operator-framework/ci-index:latest",
36353644
SourceType: operatorsv1alpha1.SourceTypeGrpc,
3645+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
3646+
SecurityContextConfig: operatorsv1alpha1.Restricted,
3647+
},
36363648
},
36373649
}
36383650
catsrc, err = crc.OperatorsV1alpha1().CatalogSources(catsrc.GetNamespace()).Create(context.Background(), catsrc, metav1.CreateOptions{})

staging/operator-lifecycle-manager/test/e2e/magic_catalog.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66

7+
"github.com/operator-framework/api/pkg/operators/v1alpha1"
78
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
89
corev1 "k8s.io/api/core/v1"
910
k8serror "k8s.io/apimachinery/pkg/api/errors"
@@ -247,6 +248,9 @@ func (c *MagicCatalog) makeCatalogSource() *operatorsv1alpha1.CatalogSource {
247248
Spec: operatorsv1alpha1.CatalogSourceSpec{
248249
SourceType: operatorsv1alpha1.SourceTypeGrpc,
249250
Address: fmt.Sprintf("%s.%s.svc:50051", c.serviceName, c.namespace),
251+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
252+
SecurityContextConfig: v1alpha1.Restricted,
253+
},
250254
},
251255
}
252256
}

staging/operator-lifecycle-manager/test/e2e/operator_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ var _ = Describe("Operator API", func() {
267267
Spec: operatorsv1alpha1.CatalogSourceSpec{
268268
SourceType: operatorsv1alpha1.SourceTypeGrpc,
269269
Image: "quay.io/operator-framework/ci-index:latest",
270+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
271+
SecurityContextConfig: operatorsv1alpha1.Restricted,
272+
},
270273
},
271274
}
272275
cs.SetNamespace(ns.GetName())

staging/operator-lifecycle-manager/test/e2e/packagemanifest_e2e_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ var _ = Describe("Package Manifest API lists available Operators from Catalog So
211211
SourceType: v1alpha1.SourceTypeGrpc,
212212
Image: image,
213213
DisplayName: displayName,
214+
GrpcPodConfig: &v1alpha1.GrpcPodConfig{
215+
SecurityContextConfig: v1alpha1.Restricted,
216+
},
214217
},
215218
}
216219

staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,9 @@ var _ = Describe("Subscription", func() {
773773
},
774774
Spec: operatorsv1alpha1.CatalogSourceSpec{
775775
SourceType: "goose",
776+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
777+
SecurityContextConfig: operatorsv1alpha1.Restricted,
778+
},
776779
},
777780
}
778781

@@ -832,6 +835,9 @@ var _ = Describe("Subscription", func() {
832835
},
833836
Spec: operatorsv1alpha1.CatalogSourceSpec{
834837
SourceType: operatorsv1alpha1.SourceTypeGrpc,
838+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
839+
SecurityContextConfig: operatorsv1alpha1.Restricted,
840+
},
835841
},
836842
}
837843

@@ -889,6 +895,9 @@ var _ = Describe("Subscription", func() {
889895
},
890896
Spec: operatorsv1alpha1.CatalogSourceSpec{
891897
SourceType: operatorsv1alpha1.SourceTypeInternal,
898+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
899+
SecurityContextConfig: operatorsv1alpha1.Restricted,
900+
},
892901
},
893902
}
894903

@@ -942,6 +951,9 @@ var _ = Describe("Subscription", func() {
942951
},
943952
Spec: operatorsv1alpha1.CatalogSourceSpec{
944953
SourceType: operatorsv1alpha1.SourceTypeInternal,
954+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
955+
SecurityContextConfig: operatorsv1alpha1.Restricted,
956+
},
945957
},
946958
}
947959

@@ -2528,6 +2540,9 @@ var (
25282540
Spec: operatorsv1alpha1.CatalogSourceSpec{
25292541
SourceType: "internal",
25302542
ConfigMap: catalogConfigMapName,
2543+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
2544+
SecurityContextConfig: operatorsv1alpha1.Restricted,
2545+
},
25312546
},
25322547
}
25332548
)

staging/operator-lifecycle-manager/test/e2e/util.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636

3737
gtypes "github.com/onsi/gomega/types"
3838
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
39+
"github.com/operator-framework/api/pkg/operators/v1alpha1"
3940
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
4041
"github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned"
4142
"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/bundle"
@@ -582,6 +583,9 @@ func createInvalidGRPCCatalogSource(c operatorclient.ClientInterface, crc versio
582583
Spec: operatorsv1alpha1.CatalogSourceSpec{
583584
SourceType: "grpc",
584585
Image: "localhost:0/not/exists:catsrc",
586+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
587+
SecurityContextConfig: v1alpha1.Restricted,
588+
},
585589
},
586590
}
587591

@@ -616,6 +620,9 @@ func createInternalCatalogSource(
616620
Spec: operatorsv1alpha1.CatalogSourceSpec{
617621
SourceType: "internal",
618622
ConfigMap: configMap.GetName(),
623+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
624+
SecurityContextConfig: v1alpha1.Restricted,
625+
},
619626
},
620627
}
621628

@@ -657,6 +664,9 @@ func createInternalCatalogSourceWithPriority(c operatorclient.ClientInterface,
657664
SourceType: "internal",
658665
ConfigMap: configMap.GetName(),
659666
Priority: priority,
667+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
668+
SecurityContextConfig: v1alpha1.Restricted,
669+
},
660670
},
661671
}
662672
catalogSource.SetNamespace(namespace)
@@ -700,6 +710,9 @@ func createV1CRDInternalCatalogSource(
700710
Spec: operatorsv1alpha1.CatalogSourceSpec{
701711
SourceType: "internal",
702712
ConfigMap: configMap.GetName(),
713+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
714+
SecurityContextConfig: v1alpha1.Restricted,
715+
},
703716
},
704717
}
705718
catalogSource.SetNamespace(namespace)

staging/operator-lifecycle-manager/test/e2e/webhook_e2e_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,9 @@ var _ = Describe("CSVs with a Webhook", func() {
669669
Spec: operatorsv1alpha1.CatalogSourceSpec{
670670
SourceType: operatorsv1alpha1.SourceTypeGrpc,
671671
Image: catSrcImage + ":0.0.3",
672+
GrpcPodConfig: &operatorsv1alpha1.GrpcPodConfig{
673+
SecurityContextConfig: operatorsv1alpha1.Restricted,
674+
},
672675
},
673676
}
674677

0 commit comments

Comments
 (0)