summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/loader.go
diff options
context:
space:
mode:
authorIan Lewis <ianlewis@google.com>2018-11-01 17:39:20 -0700
committerShentubot <shentubot@google.com>2018-11-01 17:40:09 -0700
commit9d69d85bc13d4f0956a39951b5cd6777f938cffd (patch)
treea616e7277ab1712dd23b505c33591d1bc1e0cab2 /runsc/boot/loader.go
parent0e277a39c8b6f905e289b75e8ad0594e6b3562ca (diff)
Make error messages a bit more user friendly.
Updated error messages so that it doesn't print full Go struct representations when running a new container in a sandbox. For example, this occurs frequently when commands are not found when doing a 'kubectl exec'. PiperOrigin-RevId: 219729141 Change-Id: Ic3a7bc84cd7b2167f495d48a1da241d621d3ca09
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r--runsc/boot/loader.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index abb347835..380fa3fbf 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -618,7 +618,7 @@ func (l *Loader) executeAsync(args *control.ExecArgs) (kernel.ThreadID, error) {
ep, ok := l.processes[rootKey]
l.mu.Unlock()
if !ok {
- return 0, fmt.Errorf("cannot exec in container %q: no such container", args.ContainerID)
+ return 0, fmt.Errorf("no such container: %q", args.ContainerID)
}
ep.tg.Leader().WithMuLocked(func(t *kernel.Task) {
args.Root = t.FSContext().RootDirectory()
@@ -631,7 +631,7 @@ func (l *Loader) executeAsync(args *control.ExecArgs) (kernel.ThreadID, error) {
proc := control.Proc{Kernel: l.k}
tg, tgid, ttyFile, err := control.ExecAsync(&proc, args)
if err != nil {
- return 0, fmt.Errorf("error executing: %+v: %v", args, err)
+ return 0, err
}
// Insert the process into processes so that we can wait on it