mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
edit: Make environment variables composable
It also adds support for KUBE_EDITOR and GIT_EDITOR which were already advertised in the edit usage message.
This commit is contained in:
committed by
Michail Kargakis
parent
a7425bf070
commit
523b6ec7e3
@@ -46,9 +46,9 @@ const (
|
||||
editLong = `Edit a resource from the default editor.
|
||||
|
||||
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, GIT_EDITOR,
|
||||
or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows.
|
||||
You can edit multiple objects, although changes are applied one at a time. The command
|
||||
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.
|
||||
You can edit multiple objects, although changes are applied one at a time. The command
|
||||
accepts filenames as well as command line arguments, although the files you point to must
|
||||
be previously saved versions of resources.
|
||||
|
||||
@@ -148,7 +148,7 @@ func RunEdit(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []strin
|
||||
}
|
||||
|
||||
windowsLineEndings := cmdutil.GetFlagBool(cmd, "windows-line-endings")
|
||||
edit := editor.NewDefaultEditor()
|
||||
edit := editor.NewDefaultEditor(f.EditorEnvs())
|
||||
defaultVersion := cmdutil.OutputVersionFromGroupVersion(cmd, clientConfig.GroupVersion)
|
||||
results := editResults{}
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user