Skip to content

Commit

Permalink
Don't send error to stdout (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin authored Aug 5, 2024
1 parent 3c8a8fa commit 1ce8a1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions cli/cmd/customer_create.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package cmd

import (
"fmt"
"os"
"time"

"github.com/pkg/errors"
"github.com/replicatedhq/replicated/cli/print"
"github.com/replicatedhq/replicated/client"
"github.com/replicatedhq/replicated/pkg/kotsclient"
"github.com/replicatedhq/replicated/pkg/logger"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -102,8 +102,9 @@ func (r *runners) createCustomer(cmd *cobra.Command, _ []string) (err error) {
}

if !foundDefaultChannel {
log := logger.NewLogger(os.Stdout)
log.Info("No default channel specified, defaulting to the first channel specified.")
if len(channels) > 1 {
fmt.Fprintln(os.Stderr, "No default channel specified, defaulting to the first channel specified.")
}
firstChannel := channels[0]
firstChannel.IsDefault = true
channels[0] = firstChannel
Expand Down
7 changes: 4 additions & 3 deletions cli/cmd/customer_update.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package cmd

import (
"fmt"
"os"
"time"

"github.com/pkg/errors"
"github.com/replicatedhq/replicated/cli/print"
"github.com/replicatedhq/replicated/client"
"github.com/replicatedhq/replicated/pkg/kotsclient"
"github.com/replicatedhq/replicated/pkg/logger"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -107,8 +107,9 @@ func (r *runners) updateCustomer(cmd *cobra.Command, _ []string) (err error) {
}

if !foundDefaultChannel {
log := logger.NewLogger(os.Stdout)
log.Info("No default channel specified, defaulting to the first channel specified.")
if len(channels) > 1 {
fmt.Fprintln(os.Stderr, "No default channel specified, defaulting to the first channel specified.")
}
firstChannel := channels[0]
firstChannel.IsDefault = true
channels[0] = firstChannel
Expand Down

0 comments on commit 1ce8a1e

Please sign in to comment.