Skip to content

Commit d135b07

Browse files
committed
Update Single Group to Multi-Group Documentation to Add Webhooks Details
1 parent 54fba41 commit d135b07

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ can check `api/v1/groupversion_info.go` to find that out:
3838
package v1
3939
```
4040

41-
Then, we'll rename move our existing APIs into a new subdirectory, "batch":
41+
Then, we'll move our existing APIs into a new subdirectory named after the group. Considering the [CronJob example][cronjob-tutorial], subdirectory name is "batch":
4242

4343
```bash
4444
mkdir api/batch
@@ -52,6 +52,13 @@ mkdir internal/controller/batch
5252
mv internal/controller/* internal/controller/batch/
5353
```
5454

55+
The same needs to be applied for any pre-existing [webhooks][webhooks]:
56+
```bash
57+
mkdir internal/webhook/batch
58+
mv internal/webhook/* internal/webhook/batch/
59+
```
60+
For any new webhook created for a new group, the respective functions will be created under subdirectory `internal/webhook/<group>/`.
61+
5562
<aside class="note">
5663
<h1>If you are using the deprecated layout go/v3</h1>
5764
Then, your layout has not the internal directory. So, you will move the controller(s) under a directory with the name of the API group which it is responsible for manage.
@@ -122,3 +129,4 @@ single-group projects).
122129
[multi-group-issue]: https://github.com/kubernetes-sigs/kubebuilder/issues/923 "Kubebuilder Issue #923"
123130
[cronjob-tutorial]: /cronjob-tutorial/cronjob-tutorial.md "Tutorial: Building CronJob"
124131
[migration-guide]: /migration/migration_guide_gov3_to_gov4.md "Migration from go/v3 to go/v4"
132+
[webhooks]: /cronjob-tutorial/webhook-implementation.md "Implementing defaulting/validating webhooks"

0 commit comments

Comments
 (0)