From 0a508ad8067dcc8d48420daca536fca09df5846b Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Mon, 13 Mar 2023 00:01:39 +0530 Subject: [PATCH 1/3] Update `kubectl edit` documentation kubectl defaults to /bin/bash if the SHELL environment variable isn't set. Updating the docs to mention that you can override the shell location by setting the SHELL environment variable. --- staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go b/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go index 3dff3b4904f..8305d2ef5fe 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go @@ -44,6 +44,9 @@ var ( The default format is YAML. To edit in JSON, specify "-o json". + Shell defaults to /bin/bash if the SHELL environment variable is not set. + To override the shell location set the SHELL environment variable with the desired shell location. + The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used. From e0d5c4aa93e6279979a60db5c8357799c2d54a8f Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Sat, 8 Apr 2023 00:27:13 +0530 Subject: [PATCH 2/3] Move info where its most relevant --- staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go b/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go index 8305d2ef5fe..3964c0ab324 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go @@ -35,6 +35,10 @@ var ( The edit command allows you to directly edit any API resource you can retrieve via the command-line tools. It will open the editor defined by your KUBE_EDITOR, or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows. + When attempting to open the editor, it will first attempt to use the shell + that has been defined in the 'SHELL' environment variable. If this is not defined, + the default shell will be used, which is '/bin/bash' for Linux or 'cmd' for Windows. + You can edit multiple objects, although changes are applied one at a time. The command accepts file names as well as command-line arguments, although the files you point to must be previously saved versions of resources. From 28ac914bc54a946188b98254dfe85a0d721e22f5 Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Mon, 24 Apr 2023 10:22:08 +0530 Subject: [PATCH 3/3] Remove repeated info --- staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go b/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go index 3964c0ab324..39a3a70e4e0 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/edit/edit.go @@ -48,9 +48,6 @@ var ( The default format is YAML. To edit in JSON, specify "-o json". - Shell defaults to /bin/bash if the SHELL environment variable is not set. - To override the shell location set the SHELL environment variable with the desired shell location. - The flag --windows-line-endings can be used to force Windows line endings, otherwise the default for your operating system will be used.