From f0cd1ad04e3a5eca2ffb1a43b5a6563afa47b1b0 Mon Sep 17 00:00:00 2001 From: Cao Shufeng Date: Thu, 1 Mar 2018 16:39:31 +0800 Subject: [PATCH] fix warning info format Before this change: ``` $ kubectl exec -p nginx-aaaaaaaaaaaaa-67b58bf687-r68b9 ls -p POD_NAME is DEPRECATED and will be removed in a future version. Use exec POD_NAME instead.bin boot dev ... $ kubectl scale --replicas=2 job/pi kubectl scale job is DEPRECATED and will be removed in a future version.job.batch "pi" scaled ``` After this change: ``` $ kubectl exec -p nginx-aaaaaaaaaaaaa-67b58bf687-r68b9 ls -p POD_NAME is DEPRECATED and will be removed in a future version. Use exec POD_NAME instead. bin boot dev ... $ kubectl scale --replicas=2 job/pi kubectl scale job is DEPRECATED and will be removed in a future version. job.batch "pi" scaled ``` --- pkg/kubectl/cmd/cmd.go | 2 +- pkg/kubectl/cmd/scale.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kubectl/cmd/cmd.go b/pkg/kubectl/cmd/cmd.go index d22dabb63e5..c9916a0358e 100644 --- a/pkg/kubectl/cmd/cmd.go +++ b/pkg/kubectl/cmd/cmd.go @@ -355,7 +355,7 @@ func runHelp(cmd *cobra.Command, args []string) { } func printDeprecationWarning(errOut io.Writer, command, alias string) { - fmt.Fprintf(errOut, "%s is DEPRECATED and will be removed in a future version. Use %s instead.", alias, command) + fmt.Fprintf(errOut, "%s is DEPRECATED and will be removed in a future version. Use %s instead.\n", alias, command) } // deprecatedAlias is intended to be used to create a "wrapper" command around diff --git a/pkg/kubectl/cmd/scale.go b/pkg/kubectl/cmd/scale.go index 93332c3db62..2cde007c776 100644 --- a/pkg/kubectl/cmd/scale.go +++ b/pkg/kubectl/cmd/scale.go @@ -147,7 +147,7 @@ func RunScale(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args mapping := info.ResourceMapping() if mapping.Resource == "jobs" { - fmt.Fprintf(errOut, "%s scale job is DEPRECATED and will be removed in a future version.", cmd.Parent().Name()) + fmt.Fprintf(errOut, "%s scale job is DEPRECATED and will be removed in a future version.\n", cmd.Parent().Name()) } scaler, err := f.Scaler(mapping)