Skip to content

Commit b152eb3

Browse files
committed
UPSTREAM: <carry>: OCPBUGS-32580: allow override of NewVolumeManagerReconstruction
1 parent 401bb48 commit b152eb3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package features
2+
3+
import (
4+
"os"
5+
6+
"k8s.io/apimachinery/pkg/util/runtime"
7+
utilfeature "k8s.io/apiserver/pkg/util/feature"
8+
"k8s.io/klog/v2"
9+
)
10+
11+
// This override should only be used with a support exception. It provides a way
12+
// to set the NewVolumeManagerReconstruction feature gate in a way that still
13+
// allows the cluster to be upgradable. This is only needed on 4.14, since the
14+
// feature gate defaults to true on 4.15 and later. Owners: @jsafrane @dobsonj
15+
func OpenShiftNewVolumeManagerReconstructionOverride() {
16+
overrideVariable := "OCP_4_14_SUPPORT_EXCEPTION_ENABLE_NEW_VOLUME_MANAGER_RECONSTRUCTION"
17+
_, enabled := os.LookupEnv(overrideVariable)
18+
if enabled {
19+
klog.Infof("Environment variable %s is set, setting feature gate %s to true", overrideVariable, string(NewVolumeManagerReconstruction))
20+
fg := map[string]bool{string(NewVolumeManagerReconstruction): true}
21+
runtime.Must(utilfeature.DefaultMutableFeatureGate.SetFromMap(fg))
22+
}
23+
}
24+
25+
func init() {
26+
OpenShiftNewVolumeManagerReconstructionOverride()
27+
}

0 commit comments

Comments
 (0)