Use logrus instead of printf for warning
Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
parent
ff91f225fa
commit
fa62b6d238
@ -20,7 +20,6 @@ package run
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
gocontext "context"
|
gocontext "context"
|
||||||
"fmt"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -34,6 +33,7 @@ import (
|
|||||||
"github.com/containerd/containerd/runtime/v2/runc/options"
|
"github.com/containerd/containerd/runtime/v2/runc/options"
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -247,14 +247,14 @@ func getNewTaskOpts(context *cli.Context) []containerd.NewTaskOpts {
|
|||||||
if uidmap := context.String("uidmap"); uidmap != "" {
|
if uidmap := context.String("uidmap"); uidmap != "" {
|
||||||
uidMap, err := parseIDMapping(uidmap)
|
uidMap, err := parseIDMapping(uidmap)
|
||||||
if err != nil {
|
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))
|
tOpts = append(tOpts, containerd.WithUIDOwner(uidMap.HostID))
|
||||||
}
|
}
|
||||||
if gidmap := context.String("gidmap"); gidmap != "" {
|
if gidmap := context.String("gidmap"); gidmap != "" {
|
||||||
gidMap, err := parseIDMapping(gidmap)
|
gidMap, err := parseIDMapping(gidmap)
|
||||||
if err != nil {
|
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))
|
tOpts = append(tOpts, containerd.WithGIDOwner(gidMap.HostID))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user