-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 fix feature gate merges in ConvertToFeatureGateAPI #446
🐛 fix feature gate merges in ConvertToFeatureGateAPI #446
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thank you for your fix and detailed PR explannation.
Your fixes makes sense to me.
/assign @qiujian16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
The original idea is to let user set additional feature gate in addition to default ones. |
Signed-off-by: Tyler Gillson <[email protected]>
ff00aa1
to
75245d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mikeshng, qiujian16, TylerGillson The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
76e9b28
into
open-cluster-management-io:main
Summary
Prior to this PR, ConvertToFeatureGateAPI was incorrectly merging feature gates specified via the
--feature-gates
command line flag with the default feature flag sets.The unit tests added in this PR fail against main as follows:
Running tool: /opt/homebrew/bin/go test -timeout 30s -run ^TestConvertToFeatureGateAPI$ open-cluster-management.io/clusteradm/pkg/genericclioptions -v === RUN TestConvertToFeatureGateAPI === RUN TestConvertToFeatureGateAPI/disable_default_feature_gate /Users/tylergillson/spectrocloud/repos/oss/ocm/clusteradm/pkg/genericclioptions/feature_gates_test.go:89: expected [], got [{AddonManagement Disable}] === RUN TestConvertToFeatureGateAPI/enable_default_feature_gate /Users/tylergillson/spectrocloud/repos/oss/ocm/clusteradm/pkg/genericclioptions/feature_gates_test.go:89: expected [{AddonManagement Enable}], got [] === RUN TestConvertToFeatureGateAPI/enable_non-default_feature_gate === RUN TestConvertToFeatureGateAPI/enable_non-default_feature_gate,_ensure_default_feature_gates_remain_enabled /Users/tylergillson/spectrocloud/repos/oss/ocm/clusteradm/pkg/genericclioptions/feature_gates_test.go:89: expected [{AddonManagement Enable} {ClusterClaim Enable} {MultipleHubs Enable}], got [{MultipleHubs Enable}] --- FAIL: TestConvertToFeatureGateAPI (0.00s) --- FAIL: TestConvertToFeatureGateAPI/disable_default_feature_gate (0.00s) --- FAIL: TestConvertToFeatureGateAPI/enable_default_feature_gate (0.00s) --- PASS: TestConvertToFeatureGateAPI/enable_non-default_feature_gate (0.00s) --- FAIL: TestConvertToFeatureGateAPI/enable_non-default_feature_gate,_ensure_default_feature_gates_remain_enabled (0.00s) FAIL FAIL open-cluster-management.io/clusteradm/pkg/genericclioptions 0.730s
Now all flags are enabled, whether user-specified or enabled-by-default. Any disabled flags are simply not specified.
However, the original intention of the ConvertToFeatureGateAPI was unclear. Perhaps users should have to manually specify all desired flags instead of merging the two sets?
Related issue(s)
Fixes #