From c6fc2ef8904c32f0115ab9cdb4d807c9913dfdc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Valais?= Date: Mon, 11 Mar 2024 13:48:39 +0100 Subject: [PATCH 1/3] kubectl plugin: explain how to get autocompletion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maël Valais --- content/docs/reference/cmctl.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/content/docs/reference/cmctl.md b/content/docs/reference/cmctl.md index 53ef2cd051e..54a2fbcb6d3 100644 --- a/content/docs/reference/cmctl.md +++ b/content/docs/reference/cmctl.md @@ -361,3 +361,16 @@ these can be found on our [cmctl GitHub releases page](https://github.com/cert-m In order to use the kubectl plugin you need its binary to be accessible under the name `kubectl-cert_manager` in your `$PATH`. You can run `kubectl cert-manager help` to test that the plugin is set up properly. + +### Auto-completion with the kubectl plugin + +Since kubectl 1.26, it is possible to enable auto-completion for plugins. Assuming that you installed +`kubectl_cert-manager` in `/usr/local/bin`, you can set up auto-completion by running the following command: + +```bash +cat >kubectl_complete-cert_manager <<'EOF' +#!/usr/bin/env sh +kubectl cert-manager __complete "$@" +EOF +sudo install kubectl_complete-cert_manager /usr/local/bin +``` From a9913bc15caa530b4dbf07a78d2f54b01c9e1721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Valais?= Date: Mon, 11 Mar 2024 15:11:32 +0100 Subject: [PATCH 2/3] cmctl: explain why we used to recommend cmctl over the kubectl plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maël Valais --- content/docs/reference/cmctl.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/docs/reference/cmctl.md b/content/docs/reference/cmctl.md index 54a2fbcb6d3..5ee39ae3842 100644 --- a/content/docs/reference/cmctl.md +++ b/content/docs/reference/cmctl.md @@ -354,7 +354,10 @@ $ cmctl upgrade migrate-api-version --qps 5 --burst 10 ## Legacy kubectl plugin -While the kubectl plugin is supported, it is recommended to use `cmctl` as this enables a better experience via tab auto-completion. +We call the kubectl plugin "legacy" because we used to recommend using the standalone binary +`cmctl` rather than the kubectl plugin because kubectl plugins used to not support auto-completion. +Since kubectl 1.26, kubectl plugins support auto-completion, which means you will have the same +experience with the standalone `cmctl` binary and with the kubectl plugin. To install the plugin you need the `kubectl_cert-manager` file for the platform you're using, these can be found on our [cmctl GitHub releases page](https://github.com/cert-manager/cmctl/releases). From 46a35d0ad802140fdb4d489374bf115803830e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Valais?= Date: Tue, 12 Mar 2024 15:19:01 +0100 Subject: [PATCH 3/3] cmctl: remove the word "legacy" for the kubectl plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maël Valais --- content/docs/reference/cmctl.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/docs/reference/cmctl.md b/content/docs/reference/cmctl.md index 5ee39ae3842..f130465d0a4 100644 --- a/content/docs/reference/cmctl.md +++ b/content/docs/reference/cmctl.md @@ -352,10 +352,8 @@ Resources](https://cert-manager.io/docs/releases/upgrading/remove-deprecated-api $ cmctl upgrade migrate-api-version --qps 5 --burst 10 ``` -## Legacy kubectl plugin +## Kubectl plugin -We call the kubectl plugin "legacy" because we used to recommend using the standalone binary -`cmctl` rather than the kubectl plugin because kubectl plugins used to not support auto-completion. Since kubectl 1.26, kubectl plugins support auto-completion, which means you will have the same experience with the standalone `cmctl` binary and with the kubectl plugin.