Add utility functions for FeatureGates#1208
Add utility functions for FeatureGates#1208adambkaplan wants to merge 1 commit intoopenshift:masterfrom
Conversation
|
/assign @mfojtik /cc @deads2k @gabemontero |
8e739e5 to
63bfdac
Compare
|
Potential usage in cluster-storage-operator: openshift/cluster-storage-operator#216 |
| func getFeaturesFromTheSpec(fg *configv1.FeatureGate) ([]string, []string, error) { | ||
| // GetEnabledAndDisabledFeatures returns a list of enabled and disabled features for the given `FeatureGate` instance. | ||
| // Returns an error if the object references an unknown feature set. | ||
| func GetEnabledAndDisabledFeatures(fg *configv1.FeatureGate) ([]string, []string, error) { |
There was a problem hiding this comment.
I don't think configobservers are a good place to host any exported funcs beyond the observer.
There was a problem hiding this comment.
@sttts would a top level pkg/featuregates package be a better home for these functions?
63bfdac to
8e9ed11
Compare
|
@sttts I've updated this PR to move the utility functions to the new |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: adambkaplan The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
- Export the `getFeaturesFromTheSpec` function, renaming it `GetEnabledAndDisabledFeatures` and adding appropriate godoc. This will let library-go users determine the list of enabled and disabled features independently of the `ObserveFeatureFlags` function. - Add a general purpose function for checking if a feature gate has been enabled. - Implement unit tests for the new library functions.
8e9ed11 to
1f01c49
Compare
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
|
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
|
@openshift-bot: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
getFeaturesFromTheSpecfunction, renaming itGetEnabledAndDisabledFeaturesand adding appropriate godoc. Thiswill let library-go users determine the list of enabled and disabled
features independently of the
ObserveFeatureFlagsfunction.enabled.