From 4ab1856fa1186ebf0f251e0f98345691bce56885 Mon Sep 17 00:00:00 2001 From: Colin Dean Date: Wed, 21 Dec 2022 19:06:10 -0500 Subject: [PATCH] Use --output=yaml instead of --short since that's deprecated, too kubectl 1.25.4 bare `version` output says that `version --short` is deprecated, but I missed the note that the output of `version --short` will become the output of bare `version`. What's going away is what's displayed by bare `version` presently. Since we probably still want the long output in some form, let's dump it in YAML. It's YAML all the way down, right? --- cmd/vela-kubernetes/command.go | 2 +- cmd/vela-kubernetes/command_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/vela-kubernetes/command.go b/cmd/vela-kubernetes/command.go index 2db4722..8499667 100644 --- a/cmd/vela-kubernetes/command.go +++ b/cmd/vela-kubernetes/command.go @@ -62,7 +62,7 @@ func versionCmd(c *Config) *exec.Cmd { } // add flag for version kubectl command - flags = append(flags, "version", "--short") + flags = append(flags, "version", "--output=yaml") return exec.Command(_kubectl, flags...) } diff --git a/cmd/vela-kubernetes/command_test.go b/cmd/vela-kubernetes/command_test.go index 745d767..f46981e 100644 --- a/cmd/vela-kubernetes/command_test.go +++ b/cmd/vela-kubernetes/command_test.go @@ -40,7 +40,7 @@ func TestKubernetes_versionCmd(t *testing.T) { fmt.Sprintf("--context=%s", c.Context), fmt.Sprintf("--namespace=%s", c.Namespace), "version", - "--short", + "--output=yaml", ) got := versionCmd(c)