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

Deprecate config.BasePackages.Controller in favor of ControllerMap #195

Merged
merged 1 commit into from
May 2, 2023

Conversation

ulucinar
Copy link
Collaborator

@ulucinar ulucinar commented May 1, 2023

Description of your changes

config.BasePackages.Controller does not convey which subpackage a controller should be added to. One option would be to rely on a path component of the controller (e.g., if the controller being registered is internal/controller/eks/clusterauth, then the subpackage could be eks as deduced from the path) but the proposed ControllerMap makes this more explicit and makes it easier to override/remap if needed.

The proposed ControllerMap is a map from the controller's path to the subpackage name for the controller. Controller array is also deprecated in favor of ControllerMap.

Note: The deprecated BasePackages.Controller API still exists and behaves exactly as is (if not, it will be treated as a bug), and the new BasePackages.ControllerMap API is an optional one. In summary, this PR is intended to be backwards-compatible.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Tested via crossplane-contrib/provider-upjet-aws#680.

@ulucinar ulucinar marked this pull request as draft May 1, 2023 12:56
@ulucinar ulucinar requested a review from turkenh May 2, 2023 06:35
@ulucinar ulucinar marked this pull request as ready for review May 2, 2023 06:35
pkg/config/common.go Show resolved Hide resolved
pkg/config/provider.go Show resolved Hide resolved
@ulucinar ulucinar force-pushed the controller-map branch 2 times, most recently from 352a1ca to 0539b6c Compare May 2, 2023 15:28
- ControllerMap allows the subpackage name to be specified for the
  controller.

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
@ulucinar ulucinar merged commit 645d726 into crossplane:main May 2, 2023
@ulucinar ulucinar deleted the controller-map branch May 2, 2023 15:47
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