Skip to content

Commit 118dc31

Browse files
committed
make logging in 'kubernetes cluster kubeconfig exec-credential' conditional upon --verbose flag
1 parent ab39bd6 commit 118dc31

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

commands/kubernetes.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"encoding/json"
1919
"errors"
2020
"fmt"
21+
"io"
2122
"log"
2223
"os"
2324
"path/filepath"
@@ -1374,7 +1375,10 @@ func (s *KubernetesCommandService) RunKubernetesKubeconfigExecCredential(c *CmdC
13741375
kube := c.Kubernetes()
13751376
// it's important that we don't print anything to stdout since this command
13761377
// is used by kubectl which relies on stdout to contain _only_ the credential
1377-
logger := log.New(os.Stderr, "doctl: ", log.LstdFlags)
1378+
logger := log.New(io.Discard, "", 0)
1379+
if Verbose {
1380+
logger = log.New(os.Stderr, "doctl: ", log.LstdFlags)
1381+
}
13781382

13791383
clusterID := c.Args[0]
13801384
cachePath := cachedExecCredentialPath(clusterID)

0 commit comments

Comments
 (0)