You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the initial CRDs implemented in the single workloads.cloudfoundry.org group, we realized it may be better to organize the resources in separate groups. Because there is a relatively small blast radius to the change earlier on in the project, we should address the tech debt of a monolithic api group now.
Based directly on the multi-group kubebuilder documentation:
GIVEN/WHEN I view the github.com/cloudfoundry/cf-k8s-controller repository
THEN I see:
The CFRoute and CFDomain custom resources are in the networking.cloudfoundry.org group
The api directory is now an apis directory with workloads and networking subdirectories to hold the now separately organized resources
The controllers directory now contains workloads and networking subdirectories to hold the now separately organized controllers
The kubebuilder PROJECT file is marked as multigroup: true
AND WHEN I run tests
THEN I see the envtest based controllers/group.suite_test.go files correctly install CRDs to the test environment
Impact
Organizing custom resources and controllers more granularly in the controller repository allows for clearer separation of concerns between the different technical domains of the cf implementation.
Dev Notes
We expect the new directory structure to affect imports currently in use by the first set of cf api shim stories like:
The text was updated successfully, but these errors were encountered:
akrishna90
changed the title
[Chore]: Migrate cf-k8s-controllers to a multi-group kubebuilder project
Migrate cf-k8s-controllers to a multi-group kubebuilder project
Aug 30, 2021
Background
With the initial CRDs implemented in the single workloads.cloudfoundry.org group, we realized it may be better to organize the resources in separate groups. Because there is a relatively small blast radius to the change earlier on in the project, we should address the tech debt of a monolithic api group now.
See https://kubebuilder.io/migration/multi-group.html.
Follow the kubebuilder migration docs https://kubebuilder.io/migration/multi-group.html to reorganize the project to support multiple api groups.
Acceptance Criteria
Based directly on the multi-group kubebuilder documentation:
GIVEN/WHEN I view the
github.com/cloudfoundry/cf-k8s-controller
repositoryTHEN I see:
The CFRoute and CFDomain custom resources are in the
networking.cloudfoundry.org
groupThe
api
directory is now anapis
directory withworkloads
andnetworking
subdirectories to hold the now separately organized resourcesThe
controllers
directory now containsworkloads
andnetworking
subdirectories to hold the now separately organized controllersThe kubebuilder
PROJECT
file is marked asmultigroup: true
AND WHEN I run tests
THEN I see the envtest based
controllers/group.suite_test.go
files correctly install CRDs to the test environmentImpact
Organizing custom resources and controllers more granularly in the controller repository allows for clearer separation of concerns between the different technical domains of the cf implementation.
Dev Notes
We expect the new directory structure to affect imports currently in use by the first set of cf api shim stories like:
workloadsv1alpha1 "code.cloudfoundry.org/cf-k8s-controllers/api/v1alpha1"
becomes:
workloadsv1alpha1 "code.cloudfoundry.org/cf-k8s-controllers/apis/workloads/v1alpha1"
The text was updated successfully, but these errors were encountered: