Skip to content

Commit bd08b49

Browse files
pedjakclaude
andcommitted
test: clean up e2e tests for serviceAccount deprecation
Remove SA-specific e2e test scenarios, SA RBAC templates, and the extension developer test suite. Simplify test steps to use cluster-admin scope. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4536101 commit bd08b49

15 files changed

Lines changed: 127 additions & 605 deletions

test/e2e/features/install.feature

Lines changed: 8 additions & 97 deletions
Large diffs are not rendered by default.

test/e2e/features/proxy.feature

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Feature: HTTPS proxy support for outbound catalog requests
1010
And a catalog "test" with packages:
1111
| package | version | channel | replaces | contents |
1212
| test | 1.2.0 | beta | | CRD, Deployment, ConfigMap |
13-
And ServiceAccount "olm-sa" with needed permissions is available in test namespace
13+
And namespace "${TEST_NAMESPACE}" is available
1414

1515
@HTTPProxy
1616
Scenario: operator-controller respects HTTPS_PROXY when fetching catalog data
@@ -23,8 +23,6 @@ Feature: HTTPS proxy support for outbound catalog requests
2323
name: ${NAME}
2424
spec:
2525
namespace: ${TEST_NAMESPACE}
26-
serviceAccount:
27-
name: olm-sa
2826
source:
2927
sourceType: Catalog
3028
catalog:
@@ -54,8 +52,6 @@ Feature: HTTPS proxy support for outbound catalog requests
5452
name: ${NAME}
5553
spec:
5654
namespace: ${TEST_NAMESPACE}
57-
serviceAccount:
58-
name: olm-sa
5955
source:
6056
sourceType: Catalog
6157
catalog:

test/e2e/features/recover.feature

Lines changed: 5 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: Recover cluster extension from errors that might occur during its lifet
88
| test | 1.2.0 | beta | | CRD, Deployment, ConfigMap |
99

1010
Scenario: Restore removed resource
11-
Given ServiceAccount "olm-sa" with needed permissions is available in test namespace
11+
Given namespace "${TEST_NAMESPACE}" is available
1212
And ClusterExtension is applied
1313
"""
1414
apiVersion: olm.operatorframework.io/v1
@@ -17,8 +17,6 @@ Feature: Recover cluster extension from errors that might occur during its lifet
1717
name: ${NAME}
1818
spec:
1919
namespace: ${TEST_NAMESPACE}
20-
serviceAccount:
21-
name: olm-sa
2220
source:
2321
sourceType: Catalog
2422
catalog:
@@ -41,8 +39,6 @@ Feature: Recover cluster extension from errors that might occur during its lifet
4139
name: ${NAME}
4240
spec:
4341
namespace: ${TEST_NAMESPACE}
44-
serviceAccount:
45-
name: olm-sa
4642
source:
4743
sourceType: Catalog
4844
catalog:
@@ -52,12 +48,12 @@ Feature: Recover cluster extension from errors that might occur during its lifet
5248
"olm.operatorframework.io/metadata.name": ${CATALOG:test}
5349
"""
5450
And ClusterExtension reports Progressing as True with Reason Retrying
55-
When ServiceAccount "olm-sa" with needed permissions is available in test namespace
51+
When namespace "${TEST_NAMESPACE}" is available
5652
Then ClusterExtension is available
5753
And ClusterExtension reports Progressing as True with Reason Succeeded
5854

5955
Scenario: Install ClusterExtension after conflicting resource is removed
60-
Given ServiceAccount "olm-sa" with needed permissions is available in test namespace
56+
Given namespace "${TEST_NAMESPACE}" is available
6157
And resource is applied
6258
"""
6359
apiVersion: apps/v1
@@ -100,8 +96,6 @@ Feature: Recover cluster extension from errors that might occur during its lifet
10096
name: ${NAME}
10197
spec:
10298
namespace: ${TEST_NAMESPACE}
103-
serviceAccount:
104-
name: olm-sa
10599
source:
106100
sourceType: Catalog
107101
catalog:
@@ -117,41 +111,6 @@ Feature: Recover cluster extension from errors that might occur during its lifet
117111
And ClusterExtension reports Progressing as True with Reason Succeeded
118112
And ClusterExtension reports Installed as True
119113

120-
@PreflightPermissions
121-
Scenario: ClusterExtension installation succeeds after service account gets the required missing permissions to
122-
manage the bundle's resources
123-
Given ServiceAccount "olm-sa" is available in test namespace
124-
And ClusterExtension is applied
125-
"""
126-
apiVersion: olm.operatorframework.io/v1
127-
kind: ClusterExtension
128-
metadata:
129-
name: ${NAME}
130-
spec:
131-
namespace: ${TEST_NAMESPACE}
132-
serviceAccount:
133-
name: olm-sa
134-
source:
135-
sourceType: Catalog
136-
catalog:
137-
packageName: ${PACKAGE:test}
138-
selector:
139-
matchLabels:
140-
"olm.operatorframework.io/metadata.name": ${CATALOG:test}
141-
"""
142-
And ClusterExtension reports Progressing as True with Reason Retrying and Message includes:
143-
"""
144-
pre-authorization failed: service account requires the following permissions to manage cluster extension:
145-
"""
146-
And ClusterExtension reports Progressing as True with Reason Retrying and Message includes:
147-
"""
148-
Namespace:"" APIGroups:[apiextensions.k8s.io] Resources:[customresourcedefinitions] ResourceNames:[e2e-${SCENARIO_ID}tests.e2e-${SCENARIO_ID}.e2e.operatorframework.io] Verbs:[delete,get,patch,update]
149-
"""
150-
When ServiceAccount "olm-sa" with needed permissions is available in test namespace
151-
Then ClusterExtension is available
152-
And ClusterExtension reports Progressing as True with Reason Succeeded
153-
And ClusterExtension reports Installed as True
154-
155114
# CATALOG DELETION RESILIENCE SCENARIOS
156115

157116
Scenario: Auto-healing continues working after catalog deletion
@@ -165,7 +124,7 @@ Feature: Recover cluster extension from errors that might occur during its lifet
165124
# - If the controller stopped reconciling, the configmap would stay deleted
166125
# - Resource restoration is an observable event that PROVES active reconciliation
167126
# - The deployment staying healthy proves the workload continues running
168-
Given ServiceAccount "olm-sa" with needed permissions is available in test namespace
127+
Given namespace "${TEST_NAMESPACE}" is available
169128
And ClusterExtension is applied
170129
"""
171130
apiVersion: olm.operatorframework.io/v1
@@ -174,8 +133,6 @@ Feature: Recover cluster extension from errors that might occur during its lifet
174133
name: ${NAME}
175134
spec:
176135
namespace: ${TEST_NAMESPACE}
177-
serviceAccount:
178-
name: olm-sa
179136
source:
180137
sourceType: Catalog
181138
catalog:
@@ -205,7 +162,7 @@ Feature: Recover cluster extension from errors that might occur during its lifet
205162
# - Reconciliation completing (observedGeneration == generation) proves the spec was processed
206163
# - Progressing=Succeeded proves the controller didn't block on missing catalog
207164
# - Extension staying Available proves workload continues running
208-
Given ServiceAccount "olm-sa" with needed permissions is available in test namespace
165+
Given namespace "${TEST_NAMESPACE}" is available
209166
And ClusterExtension is applied
210167
"""
211168
apiVersion: olm.operatorframework.io/v1
@@ -214,8 +171,6 @@ Feature: Recover cluster extension from errors that might occur during its lifet
214171
name: ${NAME}
215172
spec:
216173
namespace: ${TEST_NAMESPACE}
217-
serviceAccount:
218-
name: olm-sa
219174
source:
220175
sourceType: Catalog
221176
catalog:
@@ -235,8 +190,6 @@ Feature: Recover cluster extension from errors that might occur during its lifet
235190
name: ${NAME}
236191
spec:
237192
namespace: ${TEST_NAMESPACE}
238-
serviceAccount:
239-
name: olm-sa
240193
install:
241194
preflight:
242195
crdUpgradeSafety:

test/e2e/features/revision.feature

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ Feature: Install ClusterObjectSet
1313
apiVersion: olm.operatorframework.io/v1
1414
kind: ClusterObjectSet
1515
metadata:
16-
annotations:
17-
olm.operatorframework.io/service-account-name: pvc-probe-sa
18-
olm.operatorframework.io/service-account-namespace: ${TEST_NAMESPACE}
1916
name: ${COS_NAME}
2017
spec:
2118
lifecycleState: Active
@@ -76,9 +73,6 @@ Feature: Install ClusterObjectSet
7673
apiVersion: olm.operatorframework.io/v1
7774
kind: ClusterObjectSet
7875
metadata:
79-
annotations:
80-
olm.operatorframework.io/service-account-name: pvc-probe-sa
81-
olm.operatorframework.io/service-account-namespace: ${TEST_NAMESPACE}
8276
name: ${COS_NAME}
8377
spec:
8478
lifecycleState: Active
@@ -166,9 +160,6 @@ Feature: Install ClusterObjectSet
166160
apiVersion: olm.operatorframework.io/v1
167161
kind: ClusterObjectSet
168162
metadata:
169-
annotations:
170-
olm.operatorframework.io/service-account-name: pvc-probe-sa
171-
olm.operatorframework.io/service-account-namespace: ${TEST_NAMESPACE}
172163
name: ${COS_NAME}
173164
spec:
174165
lifecycleState: Active
@@ -227,9 +218,6 @@ Feature: Install ClusterObjectSet
227218
apiVersion: olm.operatorframework.io/v1
228219
kind: ClusterObjectSet
229220
metadata:
230-
annotations:
231-
olm.operatorframework.io/service-account-name: pvc-probe-sa
232-
olm.operatorframework.io/service-account-namespace: ${TEST_NAMESPACE}
233221
name: ${COS_NAME}
234222
spec:
235223
lifecycleState: Active
@@ -339,7 +327,7 @@ Feature: Install ClusterObjectSet
339327
And ClusterObjectSet "${COS_NAME}" reports Available as True with Reason ProbesSucceeded
340328

341329
Scenario: User can install a ClusterObjectSet with objects stored in Secrets
342-
Given ServiceAccount "olm-sa" with needed permissions is available in test namespace
330+
Given namespace "${TEST_NAMESPACE}" is available
343331
When resource is applied
344332
"""
345333
apiVersion: v1
@@ -415,9 +403,6 @@ Feature: Install ClusterObjectSet
415403
apiVersion: olm.operatorframework.io/v1
416404
kind: ClusterObjectSet
417405
metadata:
418-
annotations:
419-
olm.operatorframework.io/service-account-name: olm-sa
420-
olm.operatorframework.io/service-account-namespace: ${TEST_NAMESPACE}
421406
name: ${COS_NAME}
422407
spec:
423408
lifecycleState: Active
@@ -442,7 +427,7 @@ Feature: Install ClusterObjectSet
442427
And ClusterObjectSet "${COS_NAME}" has observed phase "resources" with a non-empty digest
443428

444429
Scenario: ClusterObjectSet blocks reconciliation when referenced Secret is mutable
445-
Given ServiceAccount "olm-sa" with needed permissions is available in test namespace
430+
Given namespace "${TEST_NAMESPACE}" is available
446431
And resource is applied
447432
"""
448433
apiVersion: v1
@@ -470,9 +455,6 @@ Feature: Install ClusterObjectSet
470455
apiVersion: olm.operatorframework.io/v1
471456
kind: ClusterObjectSet
472457
metadata:
473-
annotations:
474-
olm.operatorframework.io/service-account-name: olm-sa
475-
olm.operatorframework.io/service-account-namespace: ${TEST_NAMESPACE}
476458
name: ${COS_NAME}
477459
spec:
478460
lifecycleState: Active
@@ -492,7 +474,7 @@ Feature: Install ClusterObjectSet
492474
"""
493475

494476
Scenario: ClusterObjectSet blocks reconciliation when referenced Secret content changes
495-
Given ServiceAccount "olm-sa" with needed permissions is available in test namespace
477+
Given namespace "${TEST_NAMESPACE}" is available
496478
When resource is applied
497479
"""
498480
apiVersion: v1
@@ -521,9 +503,6 @@ Feature: Install ClusterObjectSet
521503
apiVersion: olm.operatorframework.io/v1
522504
kind: ClusterObjectSet
523505
metadata:
524-
annotations:
525-
olm.operatorframework.io/service-account-name: olm-sa
526-
olm.operatorframework.io/service-account-namespace: ${TEST_NAMESPACE}
527506
name: ${COS_NAME}
528507
spec:
529508
lifecycleState: Active
@@ -601,16 +580,13 @@ Feature: Install ClusterObjectSet
601580

602581
@ProgressDeadline
603582
Scenario: Archiving a COS with ProgressDeadlineExceeded cleans up its resources
604-
Given min value for ClusterObjectSet .spec.progressDeadlineMinutes is set to 1
605-
And ServiceAccount "olm-sa" with needed permissions is available in test namespace
583+
Given namespace "${TEST_NAMESPACE}" is available
584+
And min value for ClusterObjectSet .spec.progressDeadlineMinutes is set to 1
606585
When ClusterObjectSet is applied
607586
"""
608587
apiVersion: olm.operatorframework.io/v1
609588
kind: ClusterObjectSet
610589
metadata:
611-
annotations:
612-
olm.operatorframework.io/service-account-name: olm-sa
613-
olm.operatorframework.io/service-account-namespace: ${TEST_NAMESPACE}
614590
name: ${COS_NAME}
615591
spec:
616592
lifecycleState: Active
@@ -670,16 +646,13 @@ Feature: Install ClusterObjectSet
670646
@ProgressDeadline
671647
@Serial
672648
Scenario: COS recovers from ProgressDeadlineExceeded to Succeeded when probes pass
673-
Given min value for ClusterObjectSet .spec.progressDeadlineMinutes is set to 1
674-
And ServiceAccount "olm-sa" with needed permissions is available in test namespace
649+
Given namespace "${TEST_NAMESPACE}" is available
650+
And min value for ClusterObjectSet .spec.progressDeadlineMinutes is set to 1
675651
When ClusterObjectSet is applied
676652
"""
677653
apiVersion: olm.operatorframework.io/v1
678654
kind: ClusterObjectSet
679655
metadata:
680-
annotations:
681-
olm.operatorframework.io/service-account-name: olm-sa
682-
olm.operatorframework.io/service-account-namespace: ${TEST_NAMESPACE}
683656
name: ${COS_NAME}
684657
spec:
685658
lifecycleState: Active

test/e2e/features/status.feature

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Feature: Report status of the managed ClusterExtension workload
99
And a catalog "test" with packages:
1010
| package | version | channel | replaces | contents |
1111
| test | 1.0.0 | alpha | | CRD, Deployment, ConfigMap |
12-
And ServiceAccount "olm-sa" with needed permissions is available in test namespace
12+
And namespace "${TEST_NAMESPACE}" is available
1313
And ClusterExtension is applied
1414
"""
1515
apiVersion: olm.operatorframework.io/v1
@@ -18,8 +18,6 @@ Feature: Report status of the managed ClusterExtension workload
1818
name: ${NAME}
1919
spec:
2020
namespace: ${TEST_NAMESPACE}
21-
serviceAccount:
22-
name: olm-sa
2321
source:
2422
sourceType: Catalog
2523
catalog:

test/e2e/features/uninstall.feature

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Feature: Uninstall ClusterExtension
99
And a catalog "test" with packages:
1010
| package | version | channel | replaces | contents |
1111
| test | 1.2.0 | beta | | CRD, Deployment, ConfigMap |
12-
And ServiceAccount "olm-sa" with needed permissions is available in test namespace
12+
And namespace "${TEST_NAMESPACE}" is available
1313
And ClusterExtension is applied
1414
"""
1515
apiVersion: olm.operatorframework.io/v1
@@ -18,8 +18,6 @@ Feature: Uninstall ClusterExtension
1818
name: ${NAME}
1919
spec:
2020
namespace: ${TEST_NAMESPACE}
21-
serviceAccount:
22-
name: olm-sa
2321
source:
2422
sourceType: Catalog
2523
catalog:
@@ -36,10 +34,3 @@ Feature: Uninstall ClusterExtension
3634
When ClusterExtension is removed
3735
Then the ClusterExtension's constituent resources are removed
3836

39-
Scenario: Removing ClusterExtension resources leads to all installed resources being removed even if the service account is no longer present
40-
When resource "serviceaccount/olm-sa" is removed
41-
# Ensure service account is gone before checking to ensure resources are cleaned up whether the service account
42-
# and its permissions are present on the cluster or not
43-
And resource "serviceaccount/olm-sa" is eventually not found
44-
And ClusterExtension is removed
45-
Then the ClusterExtension's constituent resources are removed

0 commit comments

Comments
 (0)