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 <luca@berneking.net>
pull/8773/head
Luca Berneking 5 years ago
parent 467bd49bb0
commit 078aa4fd69

@ -205,7 +205,7 @@ func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string
loadPlugins(cmd, out) loadPlugins(cmd, out)
// Check permissions on critical files // Check permissions on critical files
checkPerms(out) checkPerms(log.Writer())
return cmd, nil return cmd, nil
} }

Loading…
Cancel
Save