summaryrefslogtreecommitdiffhomepage
path: root/runsc/cmd/gofer.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2019-01-18 17:35:09 -0800
committerShentubot <shentubot@google.com>2019-01-18 17:36:02 -0800
commitc1be25b78d89a3a55a32a7aa10724134eda9813d (patch)
treebb5c09cb94ab212c158041b260ed0bb480e2a9d5 /runsc/cmd/gofer.go
parentc0a981629cf44688687548490c5e665d851afe06 (diff)
Scrub runsc error messages
Removed "error" and "failed to" prefix that don't add value from messages. Adjusted a few other messages. In particular, when the container fail to start, the message returned is easier for humans to read: $ docker run --rm --runtime=runsc alpine foobar docker: Error response from daemon: OCI runtime start failed: <path> did not terminate sucessfully: starting container: starting root container [foobar]: starting sandbox: searching for executable "foobar", cwd: "/", $PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin": no such file or directory Closes #77 PiperOrigin-RevId: 230022798 Change-Id: I83339017c70dae09e4f9f8e0ea2e554c4d5d5cd1
Diffstat (limited to 'runsc/cmd/gofer.go')
-rw-r--r--runsc/cmd/gofer.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/runsc/cmd/gofer.go b/runsc/cmd/gofer.go
index 7276f3f26..43286a2e5 100644
--- a/runsc/cmd/gofer.go
+++ b/runsc/cmd/gofer.go
@@ -101,12 +101,12 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
specFile, err := specutils.OpenCleanSpec(g.bundleDir)
if err != nil {
- Fatalf("error opening spec: %v", err)
+ Fatalf("opening spec: %v", err)
}
spec, err := specutils.ReadSpecFromFile(g.bundleDir, specFile)
specFile.Close()
if err != nil {
- Fatalf("error reading spec: %v", err)
+ Fatalf("reading spec: %v", err)
}
specutils.LogSpec(spec)
@@ -120,7 +120,7 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
Fatalf("failed to chroot to %q: %v", root, err)
}
if err := syscall.Chdir("/"); err != nil {
- Fatalf("failed to change working dir: %v", err)
+ Fatalf("changing working dir: %v", err)
}
log.Infof("Process chroot'd to %q", root)
@@ -131,7 +131,7 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
PanicOnWrite: g.panicOnWrite,
})
if err != nil {
- Fatalf("Error creating attach point: %v", err)
+ Fatalf("creating attach point: %v", err)
}
ats = append(ats, ap)
log.Infof("Serving %q mapped to %q on FD %d (ro: %t)", "/", root, g.ioFDs[0], spec.Root.Readonly)
@@ -145,12 +145,12 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
}
ap, err := fsgofer.NewAttachPoint(m.Destination, cfg)
if err != nil {
- Fatalf("Error creating attach point: %v", err)
+ Fatalf("creating attach point: %v", err)
}
ats = append(ats, ap)
if mountIdx >= len(g.ioFDs) {
- Fatalf("No FD found for mount. Did you forget --io-fd? mount: %d, %v", len(g.ioFDs), m)
+ Fatalf("no FD found for mount. Did you forget --io-fd? mount: %d, %v", len(g.ioFDs), m)
}
log.Infof("Serving %q mapped on FD %d (ro: %t)", m.Destination, g.ioFDs[mountIdx], cfg.ROMount)
mountIdx++
@@ -161,7 +161,7 @@ func (g *Gofer) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
}
if err := filter.Install(); err != nil {
- Fatalf("Failed to install seccomp filters: %v", err)
+ Fatalf("installing seccomp filters: %v", err)
}
runServers(ats, g.ioFDs)
@@ -176,7 +176,7 @@ func runServers(ats []p9.Attacher, ioFDs []int) {
go func(ioFD int, at p9.Attacher) {
socket, err := unet.NewSocket(ioFD)
if err != nil {
- Fatalf("err creating server on FD %d: %v", ioFD, err)
+ Fatalf("creating server on FD %d: %v", ioFD, err)
}
s := p9.NewServer(at)
if err := s.Handle(socket); err != nil {