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

feat: add featuregate #1010

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

vie-serendipity
Copy link
Contributor

@vie-serendipity vie-serendipity commented Mar 29, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Currently, many functional configurations rely on environment variables. The pull request intends to introduce featuregates as a method to enable or disable these features. For now it only support the disk-ad-controller, with plans to expand to more features upon successful testing.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Enable disk-ad-controller through command line parameters(--feature-gates).

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 29, 2024
Copy link

linux-foundation-easycla bot commented Mar 29, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 29, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @vie-serendipity!

It looks like this is your first PR to kubernetes-sigs/alibaba-cloud-csi-driver 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/alibaba-cloud-csi-driver has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 29, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @vie-serendipity. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 29, 2024
pkg/disk/disk.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
pkg/features/features.go Outdated Show resolved Hide resolved
@huww98
Copy link
Contributor

huww98 commented Mar 29, 2024

Should we keep reading from ENV, for capability to old installations?

@vie-serendipity
Copy link
Contributor Author

Should we keep reading from ENV, for capability to old installations?
@huww98 Just reading both from environment variables and feature gates, then do a bitwise AND operation. Do you think this approach makes sense?

go.mod Outdated
@@ -123,5 +122,6 @@ replace (
github.com/stretchr/testify => github.com/stretchr/testify v1.3.0
google.golang.org/appengine => google.golang.org/appengine v1.4.0
gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.2.2
k8s.io/component-base => k8s.io/component-base v0.23.16
Copy link
Contributor

Choose a reason for hiding this comment

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

Why replace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because version 0.26 of component-base relies on a higher version of Prometheus, I'm concerned that upgrading will introduce unexpected errors. So I find replace it with a lower version.

Copy link
Contributor

Choose a reason for hiding this comment

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

what if we directly set component-base to v0.23.16? would there be any issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I set to v0.23.16, every time I execute go mod tidy, it will upgrade to v0.26.12. So I have to force to replace it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think upgrading Prometheus is fine. We have to do it sooner or later.

@huww98
Copy link
Contributor

huww98 commented Mar 29, 2024

then do a bitwise AND operation.

Do you mean OR? I think either env or feature gate should enable it.

@mowangdk
Copy link
Contributor

mowangdk commented Apr 7, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 7, 2024
@mowangdk
Copy link
Contributor

mowangdk commented Apr 8, 2024

then do a bitwise AND operation.

Do you mean OR? I think either env or feature gate should enable it.

+1 and feature-gate should be a higher priority

@vie-serendipity
Copy link
Contributor Author

vie-serendipity commented Apr 8, 2024

Yes, I meant OR, I typed it wrong back then. @huww98 @mowangdk
What does higher priority mean? If the feature gate is disabled and the environment variable is set to true, should it be disabled?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 8, 2024
@mowangdk
Copy link
Contributor

mowangdk commented Apr 8, 2024

@vie-serendipity please solve the conflict

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 9, 2024
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 10, 2024
@mowangdk
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 10, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mowangdk, vie-serendipity

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2024
@k8s-ci-robot k8s-ci-robot merged commit 242df8a into kubernetes-sigs:master Apr 10, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants