From 078aa4fd696a83fcb60d1b993876571e95f35e65 Mon Sep 17 00:00:00 2001 From: Luca Berneking Date: Sun, 20 Sep 2020 21:59:38 +0200 Subject: [PATCH] Log config permission warning to default logger writer (stderr) This PR changes the writer of the warning ```WARNING: Kubernetes configuration file is [...]``` to the writer of the default logger, which is `stderr`. This is needed to always show the warning to the user instead of it being parsed by other tools. Im running `source <(helm completion zsh)` in my `.zshrc` and noticed this error on every start of a new terminal: ```/proc/self/fd/11:1: command not found: WARNING:``` In this case it is not even visible to the user that helm caused the issue. With this PR the full warning is displayed to the user instead. We could also use the logger `log.Warn`? in `checkPerms` directly. Signed-off-by: Luca Berneking --- cmd/helm/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/helm/root.go b/cmd/helm/root.go index 91542bb7e..7b0b76424 100644 --- a/cmd/helm/root.go +++ b/cmd/helm/root.go @@ -205,7 +205,7 @@ func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string loadPlugins(cmd, out) // Check permissions on critical files - checkPerms(out) + checkPerms(log.Writer()) return cmd, nil }