From 62c0b387f560efedfb3cc02ba3c4803d80882d82 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Thu, 26 Sep 2019 16:12:18 -0400 Subject: Set log-level immediately, before rootless setup If we don't do this, we print WARN level messages that we should not be printing by default. Up one WARN message to ERROR so it still shows up by default. Fixes: #4115 Fixes: #4012 Signed-off-by: Matthew Heon --- cmd/podman/main.go | 18 +++++++++--------- pkg/rootless/rootless_linux.go | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/podman/main.go b/cmd/podman/main.go index 992dbe1d5..8cc8a0b8e 100644 --- a/cmd/podman/main.go +++ b/cmd/podman/main.go @@ -107,15 +107,6 @@ func before(cmd *cobra.Command, args []string) error { os.Exit(1) } - if err := setupRootless(cmd, args); err != nil { - return err - } - - // check that global opts input is valid - if err := checkInput(); err != nil { - return err - } - // Set log level; if not log-level is provided, default to error logLevel := MainGlobalOpts.LogLevel if logLevel == "" { @@ -130,6 +121,15 @@ func before(cmd *cobra.Command, args []string) error { return err } + if err := setupRootless(cmd, args); err != nil { + return err + } + + // check that global opts input is valid + if err := checkInput(); err != nil { + return err + } + if err := setRLimits(); err != nil { return err } diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go index ecb84f6a9..6f6239e5f 100644 --- a/pkg/rootless/rootless_linux.go +++ b/pkg/rootless/rootless_linux.go @@ -365,7 +365,7 @@ func GetConfiguredMappings() ([]idtools.IDMap, []idtools.IDMap, error) { } mappings, err := idtools.NewIDMappings(username, username) if err != nil { - logrus.Warnf("cannot find mappings for user %s: %v", username, err) + logrus.Errorf("cannot find mappings for user %s: %v", username, err) } else { uids = mappings.UIDs() gids = mappings.GIDs() -- cgit v1.2.3-54-g00ecf