docs: update CRD path for multi-group api
Added missing documentation for updating CRD paths update for envtest.
@@ -77,6 +77,15 @@ Also, note that the controllers will be created under `controllers/<group>` inst
That is the reason why we moved the previously generated APIs with the provided scripts in the previous steps.
Remember to update the references afterwards.
+For envtest to install CRDs correctly into the test environment, the relative path to the CRD directory needs to be updated accordingly in each `controllers/<group>/suite_test.go` file. We need to add additional `".."` to our CRD directory relative path as shown below.
+
+```go
+ By("bootstrapping test environment")
+ testEnv = &envtest.Environment{
+ CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
+ }
+```
+
The [CronJob tutorial][cronjob-tutorial] explains each of these changes in
more detail (in the context of how they're generated by KubeBuilder for
single-group projects).
