Skip to content

Commit

Permalink
Use logrus instead of printf for warning
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
  • Loading branch information
estesp committed Dec 13, 2019
1 parent ff91f22 commit fa62b6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/ctr/commands/run/run_unix.go
Expand Up @@ -20,7 +20,6 @@ package run

import (
gocontext "context"
"fmt"
"path/filepath"
"strconv"
"strings"
Expand All @@ -34,6 +33,7 @@ import (
"github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)

Expand Down Expand Up @@ -247,14 +247,14 @@ func getNewTaskOpts(context *cli.Context) []containerd.NewTaskOpts {
if uidmap := context.String("uidmap"); uidmap != "" {
uidMap, err := parseIDMapping(uidmap)
if err != nil {
fmt.Printf("warning: expected to parse uidmap: %s\n", err.Error())
logrus.WithError(err).Warn("unable to parse uidmap; defaulting to uid 0 IO ownership")
}
tOpts = append(tOpts, containerd.WithUIDOwner(uidMap.HostID))
}
if gidmap := context.String("gidmap"); gidmap != "" {
gidMap, err := parseIDMapping(gidmap)
if err != nil {
fmt.Printf("warning: expected to parse uidmap: %s\n", err.Error())
logrus.WithError(err).Warn("unable to parse gidmap; defaulting to gid 0 IO ownership")
}
tOpts = append(tOpts, containerd.WithGIDOwner(gidMap.HostID))
}
Expand Down

0 comments on commit fa62b6d

Please sign in to comment.