Skip to content

Commit 4e612ee

Browse files
Update external plugin documentation with config field
Co-authored-by: camilamacedo86 <[email protected]>
1 parent 9f9daf8 commit 4e612ee

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/book/src/plugins/extending/external-plugins.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,28 @@ structures.
4141
}
4242
```
4343

44+
**Note:** When executing commands other than `init` (e.g., `create api`, `create webhook`, `edit`), the `PluginRequest` will also include a `config` field containing the PROJECT file configuration:
45+
46+
```json
47+
{
48+
"apiVersion": "v1alpha1",
49+
"args": ["--group", "crew", "--version", "v1", "--kind", "Captain"],
50+
"command": "create api",
51+
"universe": {},
52+
"config": {
53+
"domain": "my.domain",
54+
"repo": "github.com/example/my-project",
55+
"projectName": "my-project",
56+
"version": "3",
57+
"layout": ["go.kubebuilder.io/v4"],
58+
"multigroup": false,
59+
"resources": []
60+
}
61+
}
62+
```
63+
64+
The `config` field provides external plugins access to the PROJECT file configuration, enabling them to make informed decisions based on the project's settings. This field may be empty during the `init` command if the PROJECT file has not been created yet.
65+
4466
### PluginResponse
4567

4668
`PluginResponse` contains the modifications made by the plugin to the project. This data is serialized as JSON and returned to Kubebuilder through `stdout`.

0 commit comments

Comments
 (0)