Skip to content

Commit 1a74c97

Browse files
committed
docs: update CRD path for multi-group api
Added missing documentation for updating CRD paths update for envtest. Signed-off-by: Abdul Halim <[email protected]>
1 parent 2b46403 commit 1a74c97

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/book/src/migration/multi-group.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ Also, note that the controllers will be created under `controllers/<group>` inst
7777
That is the reason why we moved the previously generated APIs with the provided scripts in the previous steps.
7878
Remember to update the references afterwards.
7979

80+
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.
81+
82+
```go
83+
By("bootstrapping test environment")
84+
testEnv = &envtest.Environment{
85+
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
86+
}
87+
```
88+
8089
The [CronJob tutorial][cronjob-tutorial] explains each of these changes in
8190
more detail (in the context of how they're generated by KubeBuilder for
8291
single-group projects).

0 commit comments

Comments
 (0)