From 01e344feb6368647dc1a48c7a3a27b5852f9b89d Mon Sep 17 00:00:00 2001 From: Sally O'Malley Date: Wed, 12 Aug 2020 12:23:23 -0400 Subject: [PATCH] get: -o yaml, json set ServerPrint false --- staging/src/k8s.io/kubectl/pkg/cmd/get/get.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/get/get.go b/staging/src/k8s.io/kubectl/pkg/cmd/get/get.go index 6387d78506e..6cd180cb278 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/get/get.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/get/get.go @@ -215,7 +215,7 @@ func (o *GetOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []stri // TODO (soltysh): currently we don't support custom columns // with server side print. So in these cases force the old behavior. outputOption := cmd.Flags().Lookup("output").Value.String() - if outputOption == "custom-columns" { + if strings.Contains(outputOption, "custom-columns") || outputOption == "yaml" || strings.Contains(outputOption, "json") { o.ServerPrint = false }