fix(featuregate): make feature gate independent of controller#426
fix(featuregate): make feature gate independent of controller#426kmova merged 2 commits intoopenebs-archive:masterfrom
Conversation
42ea84e to
0a0e057
Compare
make feature gate independent of controller. Now the feature gate can be accessed via a global feature gate variable. This enables to use the feature in all code paths even if it is independent of the controller. Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
0a0e057 to
dd99228
Compare
Codecov Report
@@ Coverage Diff @@
## master #426 +/- ##
==========================================
- Coverage 44.35% 43.90% -0.45%
==========================================
Files 60 60
Lines 2859 2906 +47
==========================================
+ Hits 1268 1276 +8
- Misses 1489 1526 +37
- Partials 102 104 +2
Continue to review full report at Codecov.
|
|
|
||
| // DefaultFeatureGate is the global feature gate that can be used to check if a feature is enabled | ||
| // or disabled | ||
| var DefaultFeatureGates = NewFeatureGate() |
There was a problem hiding this comment.
n_: DefaultFeatureGates => FeatureGates or a generic name as it contains both default and those enabled via ENV etc,. right?
There was a problem hiding this comment.
FeatureGates was not used because there is already a FeatureGate type in the same package.
Do you have suggestion for any other generic names?
There was a problem hiding this comment.
FeatureGate will renamed to featureFlag, and DefaultFeatureGates to FeatureGates
- rename FeatureGate type to featureFlag - rename DefaultFeatureGates to FeatureGates Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
Signed-off-by: Akhil Mohan akhil.mohan@mayadata.io
Why is this PR required? What issue does it fix?:
The feature gate used to be a part of the daemon controller. This restricted its use to only code paths which had access to the controller pointer. This PR removes the dependency of feature gates on the daemon controller and can be used globally across the code base.
What this PR does?:
FeatureGatesin features package which holds the state of all features.Does this PR require any upgrade changes?:
No
If the changes in this PR are manually verified, list down the scenarios covered::
Any additional information for your reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs
Checklist:
<type>(<scope>): <subject>