Skip to content

Commit

Permalink
Pass gcloud stderr to logs.Warn (#1284)
Browse files Browse the repository at this point in the history
This should reduce log spam to stderr for clients using google.Keychain
when they don't have Google auth configured.
  • Loading branch information
imjasonh authored Feb 9, 2022
1 parent d3202cc commit a44adc3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/v1/google/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"context"
"encoding/json"
"fmt"
"os"
"os/exec"
"time"

Expand Down Expand Up @@ -155,7 +154,7 @@ func (gs gcloudSource) Token() (*oauth2.Token, error) {
cmd.Stdout = &out

// Don't attempt to interpret stderr, just pass it through.
cmd.Stderr = os.Stderr
cmd.Stderr = logs.Warn.Writer()

if err := cmd.Run(); err != nil {
return nil, fmt.Errorf("error executing `gcloud config config-helper`: %w", err)
Expand Down

0 comments on commit a44adc3

Please sign in to comment.