Skip to content

Commit 9a4b848

Browse files
Update external plugin documentation with PluginChain field
Co-authored-by: camilamacedo86 <[email protected]>
1 parent 983acb0 commit 9a4b848

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,25 @@ structures.
3030

3131
`PluginRequest` contains the data collected from the CLI and any previously executed plugins. Kubebuilder sends this data as a JSON object to the external plugin via `stdin`.
3232

33-
**Example `PluginRequest` (triggered by `kubebuilder init --plugins sampleexternalplugin/v1 --domain my.domain`):**
33+
**Example `PluginRequest` (triggered by `kubebuilder init --plugins go/v4,sampleexternalplugin/v1 --domain my.domain`):**
3434

3535
```json
3636
{
3737
"apiVersion": "v1alpha1",
3838
"args": ["--domain", "my.domain"],
3939
"command": "init",
40-
"universe": {}
40+
"universe": {},
41+
"pluginChain": ["go.kubebuilder.io/v4", "kustomize.common.kubebuilder.io/v2", "sampleexternalplugin/v1"]
4142
}
4243
```
4344

45+
**Fields:**
46+
- `apiVersion`: Version of the PluginRequest schema.
47+
- `args`: Command-line arguments passed to the plugin.
48+
- `command`: The subcommand being executed (e.g., `init`, `create api`, `create webhook`, `edit`).
49+
- `universe`: Map of file paths to contents, updated across the plugin chain.
50+
- `pluginChain` (optional): Array of plugin keys in the chain. This allows external plugins to determine which other plugins are being used. For example, a plugin can check if `go.kubebuilder.io/v4` or `go.kubebuilder.io/v3` is in the chain to adjust its scaffolding accordingly.
51+
4452
### PluginResponse
4553

4654
`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)