Inject feature gate instance into client-go for kube components.#122738
Inject feature gate instance into client-go for kube components.#122738k8s-ci-robot merged 2 commits intokubernetes:masterfrom
Conversation
|
/assign @p0lyn0mial /hold Holding for proof PR demonstrating a client feature wired to a kube component. |
12b1839 to
969fa85
Compare
pkg/features/client_adapter.go
Outdated
| "k8s.io/component-base/featuregate" | ||
| ) | ||
|
|
||
| type clientFeatureGateAdapter struct { |
There was a problem hiding this comment.
could you rename it to clientFeatureGatesAdapter ?
we use the plural form across https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/client-go/features
There was a problem hiding this comment.
Renamed to clientAdapter. It adapts to both clientfeatures.Gates and clientfeatures.Registry and lives in a package named features, so I felt this was more reasonable than having separate adapters per client interface or naming the type based on only one of the implemented interfaces. WDYT?
opened a proof PR #122608 for KCM |
|
@benluddy since #122571 merged you will need to slightly change TestKubeFeatures. I already did that in #122608. Feel free to pull feaa22e in here. |
969fa85 to
a52f66e
Compare
I picked that commit into this PR and added a text description to the test cases to clarify the exact behaviors under test. Please double-check that my text is accurate. |
a52f66e to
fe6b37d
Compare
In order to avoid a dependency cycle between component-base and client-go, client-go maintains parallel definitions of component-base's feature types and constants. Passing kube's default feature gate instance to client-go requires an adapter.
Co-authored-by: Ben Luddy <bluddy@redhat.com>
fe6b37d to
8a32f34
Compare
|
/lgtm @benluddy you may release hold when ready. |
|
LGTM label has been added. DetailsGit tree hash: 4acd4062c4ff546fa210c8c87fd8d3ac7cf42806 |
|
/hold cancel |
|
/assign @dims PTAL on behalf of dep-approvers. This PR adds an import of |
|
/assign @liggitt |
|
/triage accepted |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: benluddy, deads2k, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@benluddy: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. I understand the commands that are listed here. |
|
/test pull-kubernetes-verify |
Looks like this was an example of #121865 |
What type of PR is this?
/kind feature
/sig api-machinery
What this PR does / why we need it:
Registers all client-go features with the DefaultFeatureGate instance and wires client-go to perform feature checks using the same instance used for kube feature checks. For kube components, this means that client features will be exposed in the existing
--feature-gatesflag.In order to avoid a dependency cycle between component-base and client-go, client-go maintains parallel definitions of component-base's feature types and constants. Passing kube's default feature gate instance to client-go requires an adapter.
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.: