-
Notifications
You must be signed in to change notification settings - Fork 533
Support varying the apiVersion of target resources #1052
Support varying the apiVersion of target resources #1052
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marun 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 |
Rebased |
Previously the sync controller used ResourceClient to make changes to member clusters. This meant that the API endpoint configuration for a target type was always sourced from an FTC. This commit updates the sync controller to use GenericClient so that API endpoint configuration for create and update calls can be provided on a per-call basis. If values for `apiVersion` is provided via template or override for a given federated resource, that value will supersede the configuration sourced from an FTC. This is intended to allow a given federated type to manage more than one version across member clusters. For example, federated resource foo could manage a resource in cluster1 at v1, and a resource in cluster2 at v2.
Rebased |
Awesome work. This LGTM. Thanks @marun! |
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.
Thanks @marun!
/lgtm
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.
Looks good to me - modulo @font's question answered authoritatively. For testing, can we add a test to crd.go that establishes that this works by declaring multiple versions (example here), and then uses an override to differentiate the version for one of the clusters. Multiple version support has been available since 1.11 so I think we should be able to add this with confidence.
I'd be happy to get this test in an immediate follow-up, since we've established via CI that the existing feature set hasn't regressed.
Previously the sync controller used
ResourceClient
to make changes to member clusters. This meant that the API endpoint configuration for a target type was always sourced from an FTC.This PR updates the sync controller to use
GenericClient
so that API endpoint configuration for create and update calls can be provided on a per-call basis. IfapiVersion
is set via template or override for a given federated resource, that value will supersede the configuration sourced from an FTC. This is intended to allow a given federated type to manage more than one version across member clusters. For example, federated resourcefoo
could manage a resource in cluster1 at v1, and a resource in cluster2 at v2. It would still be necessary for all clusters to support the version defined in the FTC since that is what would configure the informers for member clusters.