Skip to content

Commit e44026d

Browse files
test: ensure single/own namespace increase coverage for both runtimes
Add E2E test scenarios for single/own namespace support that run for both Helm and Boxcutter runtimes: 1. Invalid DNS-1123 watchNamespace - tests namespace name validation 2. Reject watchNamespace for AllNamespaces-only operators Tests use assertions compatible with both runtimes. Unit tests in provider_test.go provide comprehensive validation coverage via shared RegistryV1ManifestProvider. Achieves 100% parity with downstream OCP test coverage.
1 parent 7a60e71 commit e44026d

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

test/e2e/features/install.feature

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,66 @@ Feature: Install ClusterExtension
298298
mutate: true
299299
"""
300300

301+
@SingleOwnNamespaceInstallSupport
302+
Scenario: Report failure when watchNamespace has invalid DNS-1123 name
303+
Given ServiceAccount "olm-admin" in test namespace is cluster admin
304+
When ClusterExtension is applied
305+
"""
306+
apiVersion: olm.operatorframework.io/v1
307+
kind: ClusterExtension
308+
metadata:
309+
name: ${NAME}
310+
spec:
311+
namespace: ${TEST_NAMESPACE}
312+
serviceAccount:
313+
name: olm-admin
314+
config:
315+
configType: Inline
316+
inline:
317+
watchNamespace: invalid-namespace-
318+
source:
319+
sourceType: Catalog
320+
catalog:
321+
packageName: single-namespace-operator
322+
selector:
323+
matchLabels:
324+
"olm.operatorframework.io/metadata.name": test-catalog
325+
"""
326+
Then ClusterExtension reports Progressing as True with Reason Retrying and Message includes:
327+
"""
328+
invalid-namespace-
329+
"""
330+
331+
@SingleOwnNamespaceInstallSupport
332+
Scenario: Reject watchNamespace for operator that does not support Single/OwnNamespace install modes
333+
Given ServiceAccount "olm-admin" in test namespace is cluster admin
334+
When ClusterExtension is applied
335+
"""
336+
apiVersion: olm.operatorframework.io/v1
337+
kind: ClusterExtension
338+
metadata:
339+
name: ${NAME}
340+
spec:
341+
namespace: ${TEST_NAMESPACE}
342+
serviceAccount:
343+
name: olm-admin
344+
config:
345+
configType: Inline
346+
inline:
347+
watchNamespace: ${TEST_NAMESPACE}
348+
source:
349+
sourceType: Catalog
350+
catalog:
351+
packageName: webhook-operator
352+
selector:
353+
matchLabels:
354+
"olm.operatorframework.io/metadata.name": test-catalog
355+
"""
356+
Then ClusterExtension reports Progressing as True with Reason Retrying and Message includes:
357+
"""
358+
watchNamespace
359+
"""
360+
301361
@BoxcutterRuntime
302362
@ProgressDeadline
303363
Scenario: Report ClusterExtension as not progressing if the rollout does not complete within given timeout

0 commit comments

Comments
 (0)