Commit e95c682
committed
Fix: Protect CRD upgrade safety preflight behind feature flag
CRD upgrade safety preflight checks run unconditionally and is not protected under the feature flag
causing massive error messages and breaking the ClusterExtension upgrades with "Too long: may not be more than 32768 bytes".
Commit cab41aa added CRD upgrade safety preflights without feature flag protection:
```go
// Always runs for everyone - not protected
preflights := []controllers.Preflight{
crdupgradesafety.NewPreflight(...),
}
```
Later, commit 543f099 added PreflightPermissions feature flag but only protected
the RBAC preauthorizer, leaving CRD upgrade safety unprotected.
Move CRD upgrade safety behind the existing `PreflightPermissions` feature flag:
```go
// Only runs when feature flag enabled
if features.OperatorControllerFeatureGate.Enabled(features.PreflightPermissions) {
preflights = append(preflights, crdupgradesafety.NewPreflight(...))
}
```
- **By Default**: Users get normal upgrades without CRD validation
- **By Opt-In with Feature flag**: enable PreflightPermissions=true for CRD safety checks
Fixes issue introduced in cab41aa1 parent 43caaae commit e95c682
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 420 | + | |
425 | 421 | | |
| 422 | + | |
| 423 | + | |
426 | 424 | | |
| 425 | + | |
427 | 426 | | |
428 | 427 | | |
429 | 428 | | |
| |||
0 commit comments