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
Remove dependency pkg/features from CCM #92201
Conversation
/ok-to-test |
/retest |
1 similar comment
/retest |
/retest |
@deads2k I have separated the setup func with init func and also moved the file to k8s.io/controller-manager. Would you please have a look when you have time? Thank you 😊 |
@@ -9,6 +9,7 @@ rules: | |||
- k8s.io/kubernetes/cmd/cloud-controller-manager/app/options | |||
- k8s.io/kubernetes/cmd/controller-manager/app | |||
- k8s.io/kubernetes/cmd/controller-manager/app/options | |||
- k8s.io/kubernetes/cmd/controller-manager/pkg/features |
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.
Should this be k8s.io/controller-manager/pkg/features
?
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.
Or removed I guess since this list is only for k8s.io/kubernetes
imports.
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.
Updated to remove this import ^^
limitations under the License. | ||
*/ | ||
|
||
package featureconst |
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.
I'm not sure that a new package featureconst
is needed to store the feature constants, just k8s.io/controller-manager/pkg/features/kube_features
would be enough I think.
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.
My understanding is that the init func will be called whenever people import k8s.io/controller-manager/pkg/feature
and we would like to separate it for the use case like allow people to depend on teh consts without gettng auto-registration
(suggested by @deads2k ).
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.
I believe Davids idea was to allow people to pick up the constants and be able to choose whether to pick up the auto-registration. The idea is to move away from the auto-registration magic. I wonder if it would make more sense to split out the init (auto-registration) into an autoregister package, so that the behavior there is a bit more explicit?
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.
Could we do this by having a single package k8s.io/controller-manager/pkg/feature
and remove init()
? That way you can consume constants, but registering gates would requier an explicit call to SetupCurrentKubernetesSpecificFeatureGates
. Or was the separate package added because we want to keep init()
for registration?
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.
If we go the auto-registration route, maybe k8s.io/controller-manager/pkg/features/register
might be cleaner?
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.
That sounds good. Updated to use k8s.io/controller-manager/pkg/features/register
. Thank you 😊
83297fb
to
5f07d35
Compare
/test pull-publishing-bot-validate |
/test pull-kubernetes-e2e-kind-ipv6 |
/test pull-kubernetes-bazel-build |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheftako, cici37, deads2k, lavalamp 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 |
/test pull-kubernetes-bazel-test |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
It is part of the effort to make CCM easier to consume(kubernetes/cloud-provider#29).
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: