Skip to content
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

🌱 Update api dependency and remove unnecessary featureGate enabling part #687

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RokibulHasan7
Copy link
Member

Summary

Related issue(s)

Fixes #

Copy link
Contributor

openshift-ci bot commented Nov 6, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: RokibulHasan7
Once this PR has been reviewed and has the lgtm label, please assign jnpacker for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@RokibulHasan7 RokibulHasan7 changed the title Update api dependency and remove unnecessary featureGate enabling part 🌱 Update api dependency and remove unnecessary featureGate enabling part Nov 6, 2024
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.37%. Comparing base (2b86b8d) to head (149ed52).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #687      +/-   ##
==========================================
- Coverage   63.64%   63.37%   -0.28%     
==========================================
  Files         182      185       +3     
  Lines       17634    17771     +137     
==========================================
+ Hits        11223    11262      +39     
- Misses       5480     5578      +98     
  Partials      931      931              
Flag Coverage Δ
unit 63.37% <100.00%> (-0.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -775,11 +767,23 @@ func ConvertToFeatureGateFlags(component string, features []operatorapiv1.Featur
continue
}

if feature.Mode == operatorapiv1.FeatureGateModeTypeDisable && defaultFeature.Default {
if feature.Mode == operatorapiv1.FeatureGateModeTypeEnable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to change this?

@@ -1572,15 +1573,15 @@ func TestConvertToFeatureGateFlags(t *testing.T) {
{
name: "unset",
features: []operatorapiv1.FeatureGate{},
desiredFlags: []string{},
desiredFlags: []string{"--feature-gates=ClusterClaim=true", "--feature-gates=AddonManagement=true"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is unset, should we keep the desireFlags unset?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user's provided featureGate is nil, the default features will be enabled automatically. So, the desiredFlags set to the default featureGate

Copy link
Member

@zhujian7 zhujian7 Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking of the case: if we set the default value in the flags explicitly(TestFeature=false), once we change the default value in the future(TestFeature=true), will the feature be changed(false to true)? This is going to be hard to decide because we do not know whether the old value(TestFeature=false) is set by default or users. What is our expectation in this case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user explicitly sets a value for a feature gate, we’re always taking that as the defined value. If the user doesn’t set any value for feature gates where Default=True, then we’re enabling those feature gates.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user doesn’t set any value for feature gates(TestFeature) where Default=False, so this PR will set the flag TestFeature=False right? If we change the TestFeature Default=True in the next release, when upgrading from this release to the next release, how do we know if the old flag TestFeature=False is set by users on purpose or set by us by default? I am asking because I think if the user intentionally disabled a feature by setting TestFeature=False, we should not enable it when upgrading.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, updated. PTAL @zhujian7

@zhujian7
Copy link
Member

/cc @qiujian16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants