Skip to content

Commit 8b41dbc

Browse files
Update README.md
1 parent ea7bf8e commit 8b41dbc

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> :warning: **Notice**
44
> * This has been tested on for kubectl v1.23 and has not been tested on the kubectl v1.24.
5-
> * Not all kubectl plugins have been tested. You can find a listed of tested plugins at [here](https://github.com/MartinSimango/kubectl-plugin_completion/blob/main/tested-plugins.txt). Please not if a plugin hasn't been tested
5+
> * Not all kubectl plugins have been tested. You can find a listed of tested plugins at [here](https://github.com/MartinSimango/kubectl-plugin_completion/blob/main/tested-plugins.txt). Please note if a plugin hasn't been tested
66
> it might cause unwanted errors such as your shell hanging.
77
> * Plugin only supports zsh and bash shells (for now).
88
@@ -40,40 +40,40 @@ The config files contain information about the available kubectl plugins along w
4040
shell: zsh
4141
shellLocation: /bin/zsh
4242
plugins:
43-
- name: cert_manager
43+
- name: access_matrix
4444
completionFunctionName: ""
45-
description: A kubectl plugin called cert_manager
45+
description: 'Show an RBAC access matrix for server resources '
4646
supportsCobraCompletion: false
47-
- name: krew
48-
completionFunctionName: _krew
49-
description: A kubectl plugin called krew
47+
- name: accurate
48+
completionFunctionName: _accurate
49+
description: 'Manage Accurate, a multi-tenancy controller '
5050
supportsCobraCompletion: true
51-
- name: stern
51+
- name: allctx
5252
completionFunctionName: ""
53-
description: A kubectl plugin called stern
54-
supportsCobraCompletion: false
55-
- name: hello
56-
completionFunctionName: ""
57-
description: A kubectl plugin called hello
53+
description: 'Run commands on contexts in your kubeconfig '
5854
supportsCobraCompletion: false
5955
- name: plugin_completion
6056
completionFunctionName: _plugin_completion
61-
description: A kubectl plugin called plugin_completion
57+
description: A kubectl plugin for allowing shell completions for kubectl plugins
6258
supportsCobraCompletion: true
59+
kubectlOverridePlugins:
60+
- allctx
6361
```
6462
6563
The above file can be generated by running:
6664
``` sh
6765
$ kubectl plugin_completion config generate
6866
```
69-
This will generate config files for all supported shells (zsh and bash). For plugins that were created using [cobra](https://github.com/spf13/cobra) and have that have a cobra completion command the `completionFunctionName` field will automatically be field in. The description for each plugin will default to: "A kubectl plugin called $plugin_name".
67+
This will generate config files for all supported shells (zsh and bash). For plugins that were created using [cobra](https://github.com/spf13/cobra) and have that have a cobra completion command the `completionFunctionName` field will automatically be field in. The description for each plugin will default to: "A kubectl plugin called $plugin_name" if the plugin is not found in the krew repository.
7068

7169
If a plugin was not created by using [cobra](https://github.com/spf13/cobra) or if the plugin was created using cobra but does not have a completion subcommand, it will be up to you to manually edit the config file and provide the name of the plugin's completion function name. This can also be done by running the `kubectl plugin_completion config edit` command as shown below:
7270

7371
```sh
7472
$ kubectl plugin_completion config edit zsh --plugin-name=plugin_name --completion-function="_completion_function_name"
7573
```
7674

75+
Plugins who's completion script override the default kubectl completion function such as the allctx plugin can be added to the kubectlOverridePlugins array. Thus typing `kubectl allctx <TAB><TAB>` will still give completions for the kubectl command.
76+
7777
The plugin_completion uses config files to generate completions specific shells in order to allow for completions for kubectl plugins. The generated completion scripts overwrite the behaviour of the completion function for the kubectl tool and extend it to allow for kubectl plugin completions.
7878

7979
## How to use

0 commit comments

Comments
 (0)