You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: enhancements/olm/single-ownnamespace-enhancement-proposal.md
+42-16Lines changed: 42 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,22 @@ Future OLM v1 bundle formats will not include these legacy install mode concepts
39
39
40
40
The registry+v1 bundle format (used by OLM v0) includes install mode declarations (AllNamespaces, MultiNamespace, SingleNamespace, OwnNamespace) that affect how bundles are rendered into Kubernetes manifests. OLM v1 deliberately simplified operator installation by focusing on AllNamespaces mode to avoid complexity, but there exists significant existing registry+v1 bundle content in catalogs that only declares support for Single and OwnNamespace install modes.
41
41
42
+
### Install Mode Upgrade Behavior Edge Case
43
+
44
+
An important edge case exists around bundle upgrades and install mode behavior consistency. Consider this scenario:
45
+
46
+
1.**Initial State**: An operator bundle (v1.0) supports only `OwnNamespace` install mode
47
+
2.**Installation**: User installs the operator without explicit `watchNamespace` configuration
48
+
3.**Bundle Update**: Operator author releases bundle (v1.1) that adds `AllNamespaces` support alongside existing `OwnNamespace` support
49
+
4.**Unintended Behavior**: Without proper validation, the system could automatically switch from `OwnNamespace` to `AllNamespaces` mode during upgrade, granting the operator cluster-wide permissions without user consent
50
+
51
+
This behavior is problematic because:
52
+
-**Security Implications**: Operators suddenly gain broader permissions than originally intended
53
+
-**Predictability**: Install mode changes occur without explicit administrator action
54
+
-**Consistency**: The same bundle configuration produces different permission scopes across versions
55
+
56
+
To address this edge case, the implementation requires explicit `watchNamespace` configuration for namespace-scoped bundles (those not supporting `AllNamespaces` mode), ensuring that install mode selection is always deliberate and consistent across bundle upgrades.
57
+
42
58
### User Stories
43
59
44
60
#### Story 1: Legacy Operator Migration
@@ -47,6 +63,9 @@ As a cluster administrator migrating from OLM v0 to OLM v1, I want to install op
47
63
#### Story 2: Operator Author Requirements
48
64
As an operator developer, I have existing registry+v1 bundles that only support Single or OwnNamespace install modes, and I want my customers to be able to deploy these operators in OpenShift with OLM v1 so that the bundle content can be properly rendered and installed without requiring me to modify my existing bundle format during the migration to OLM v1.
49
65
66
+
#### Story 3: Install Mode Consistency Across Upgrades
67
+
As a cluster administrator, I want to ensure that when I install an operator in a specific install mode (e.g., OwnNamespace), subsequent bundle upgrades that add new install mode capabilities (e.g., AllNamespaces) do not automatically change the install mode without my explicit consent, so that my operator's permission scope remains predictable and secure across versions.
68
+
50
69
### Goals
51
70
52
71
- Enable installation of registry+v1 bundles that only support SingleNamespace or OwnNamespace install modes
@@ -88,12 +107,12 @@ Update the OLMv1 operator-controller to support rendering registry+v1 bundles wi
| ✓ | - | ✓ | optional. If set, must be install namespace (default: unset) |
115
+
| ✓ | ✓ | - | optional. If set, must NOT be install namespace (default: unset) |
97
116
| ✓ | ✓ | ✓ | optional (default: unset) |
98
117
99
118
Add support for namespace-scoped operation by ensuring:
@@ -119,13 +138,18 @@ Ensure parity with OLMv0 behavior by:
119
138
-`spec.namespace`: The installation namespace where the operator pod will run
120
139
-`spec.config.inline.watchNamespace`: The namespace the operator should watch for resources
121
140
122
-
A scenario exists where the user must specify the watch namespace. Example workflow of a bundle that will require the watch namespace to be specified:
141
+
For bundles that only support namespace-scoped install modes (SingleNamespace and/or OwnNamespace, but not AllNamespaces), the `watchNamespace` configuration is **required**. Example workflow:
123
142
124
-
1. User creates ClusterExtension for a bundle that only supportes SingleNamespace install mode but does not specify the watchNamespace
143
+
1. User creates ClusterExtension for a bundle that only supports SingleNamespace or OwnNamespace install mode but does not specify the watchNamespace
125
144
2. ClusterExtension does not install. The `Installing` and `Progressing` conditions will be set to false with an error that indicates the required `watchNamespace` is not specified
126
-
3. User updates the ClusterExtension specifying the `watchNamespace` configuration to be an exiting namespace on the cluster
145
+
3. User updates the ClusterExtension specifying the `watchNamespace` configuration to be an existing namespace on the cluster
127
146
4. ClusterExtension installs successfully
128
147
148
+
This mandatory configuration requirement ensures that:
149
+
- Install mode selection is always explicit for namespace-scoped operators
150
+
- Bundle upgrades that add AllNamespaces support cannot automatically change the install mode
151
+
- Administrators maintain control over operator permission scope across all bundle versions
152
+
129
153
```
130
154
Note: Once a ClusterExtension is already installed, OLM will not prevent the `watchNamespace` parameter from being changed by the admin. OLM will reconcile again with the new parameter, however, whether the operator will then re-install successfully is dependent on the operator itself.
131
155
```
@@ -262,25 +286,25 @@ The system determines the actual install mode based on the bundle's supported in
1. **AllNamespaces-capable bundles**: When no `watchNamespace` is specified, default to `AllNamespaces` mode for maximum compatibility
304
+
2. **Namespace-scoped bundles**: When bundles only support `SingleNamespace`/`OwnNamespace` modes, `watchNamespace` configuration is **required** to prevent implicit install mode changes during bundle upgrades
305
+
3. **watchNamespace = install namespace**: Use `OwnNamespace` mode if supported, otherwise error
306
+
4. **watchNamespace ≠ install namespace**: Use `SingleNamespace` mode if supported, otherwise error
- Role/RoleBinding resources for namespace-scoped permissions in Single/OwnNamespace modes
@@ -310,6 +334,7 @@ Because we are enabling namespace-scoped operator installations, there are opera
310
334
- **Namespace Dependency**: Clear error messages when target namespaces don't exist or aren't accessible
311
335
- **Migration Complexity**: Comprehensive documentation and examples for transitioning between install modes
312
336
- **Permission Escalation**: ServiceAccount validation ensures adequate permissions without over-privileging
337
+
- **Unintended Install Mode Changes**: Requiring explicit `watchNamespace` configuration for namespace-scoped bundles prevents automatic permission scope escalation when bundle upgrades add new install mode capabilities
313
338
314
339
Currently, admins control the scope of operator installations through ClusterExtension RBAC. This enhancement adds namespace-level controls while maintaining existing security boundaries.
315
340
@@ -327,6 +352,7 @@ Operators installed in Single/OwnNamespace modes have reduced blast radius compa
327
352
| **Installation Failures** | Medium | Detailed preflight checks and validation; clear error reporting |
328
353
| **Security Boundaries** | Medium | Explicit validation of namespace permissions; RBAC properly scoped |
329
354
| **Feature Proliferation** | Low | Clear documentation that this is for legacy compatibility only |
355
+
| **Unintended Install Mode Changes** | High | Mandatory `watchNamespace` configuration for namespace-scoped bundles prevents automatic mode switching during upgrades |
0 commit comments