From 85fb99c75d58bb60e486a697f56d5f2bdb1dd163 Mon Sep 17 00:00:00 2001 From: justinsb Date: Wed, 3 Aug 2022 15:24:06 -0400 Subject: [PATCH] Positional deprecation warning should go to stderr Otherwise we break piped output with -ojson etc. --- cmd/kops/root.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/kops/root.go b/cmd/kops/root.go index de475fc1c0..7625877008 100644 --- a/cmd/kops/root.go +++ b/cmd/kops/root.go @@ -249,10 +249,10 @@ func (c *RootCmd) clusterNameArgsAllowNoCluster(clusterName *string) func(cmd *c // Everything else is an error. func (c *RootCmd) ProcessArgs(args []string) error { if len(args) > 0 { - fmt.Printf("\n") - fmt.Printf("\nClusterName as positional argument is deprecated and will be removed\n") - fmt.Printf("Use `KOPS_FEATURE_FLAGS=PositionalClusterArg` to revert to the old behavior.") - fmt.Printf("\n") + fmt.Fprintf(os.Stderr, "\n") + fmt.Fprintf(os.Stderr, "\nClusterName as positional argument is deprecated and will be removed\n") + fmt.Fprintf(os.Stderr, "Use `KOPS_FEATURE_FLAGS=PositionalClusterArg` to revert to the old behavior.") + fmt.Fprintf(os.Stderr, "\n") } if !featureflag.PositionalClusterArg.Enabled() { return nil