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

[V3] Multi-group controller import alias #1382

Closed
Adirio opened this issue Feb 21, 2020 · 1 comment · Fixed by #1498
Closed

[V3] Multi-group controller import alias #1382

Adirio opened this issue Feb 21, 2020 · 1 comment · Fixed by #1498
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Adirio
Copy link
Contributor

Adirio commented Feb 21, 2020

In v2, when multi-group is enabled, controllers are imported as [GROUP]controller:

crewcontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/crew"
foopolicycontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/foo.policy"
seacreaturescontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/sea-creatures"
shipcontroller "sigs.k8s.io/kubebuilder/testdata/project-v2-multigroup/controllers/ship"

However, any of those alias can contain multiple controllers:

  1. shipcontroller:
    1. if err = (&shipcontroller.FrigateReconciler{
    2. if err = (&shipcontroller.DestroyerReconciler{
    3. if err = (&shipcontroller.CruiserReconciler{
  2. shipcontroller:
    1. if err = (&seacreaturescontroller.KrakenReconciler{
    2. if err = (&seacreaturescontroller.LeviathanReconciler{

In v3, the import alias should be renamed to the plural version: [GROUP]controllers

Code to modify:

// TODO(v3): `&%scontrollers` should be used instead of `&%scontroller` as there may be multiple
// controller for different Kinds in the same group. However, this is a backwards incompatible
// change, and thus should be done for next project version.
multiGroupControllerImportCodeFragment = `%scontroller "%s/controllers/%s"
`

/kind feature

@Adirio Adirio added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 21, 2020
@camilamacedo86
Copy link
Member

/assign @camilamacedo86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants