summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/controller.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/boot/controller.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/boot/controller.go')
-rw-r--r--runsc/boot/controller.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/runsc/boot/controller.go b/runsc/boot/controller.go
index 36e9d2c6b..989f49388 100644
--- a/runsc/boot/controller.go
+++ b/runsc/boot/controller.go
@@ -163,7 +163,7 @@ func (cm *containerManager) StartRoot(cid *string, _ *struct{}) error {
// Tell the root container to start and wait for the result.
cm.startChan <- struct{}{}
if err := <-cm.startResultChan; err != nil {
- return fmt.Errorf("failed to start sandbox: %v", err)
+ return fmt.Errorf("starting sandbox: %v", err)
}
return nil
}
@@ -319,7 +319,7 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error {
p, err := createPlatform(cm.l.conf, int(deviceFile.Fd()))
if err != nil {
- return fmt.Errorf("error creating platform: %v", err)
+ return fmt.Errorf("creating platform: %v", err)
}
k := &kernel.Kernel{
Platform: p,
@@ -330,14 +330,14 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error {
fds := &fdDispenser{fds: cm.l.goferFDs}
renv, err := createRestoreEnvironment(cm.l.spec, cm.l.conf, fds)
if err != nil {
- return fmt.Errorf("error creating RestoreEnvironment: %v", err)
+ return fmt.Errorf("creating RestoreEnvironment: %v", err)
}
fs.SetRestoreEnvironment(*renv)
// Prepare to load from the state file.
networkStack, err := newEmptyNetworkStack(cm.l.conf, k)
if err != nil {
- return fmt.Errorf("failed to create network: %v", err)
+ return fmt.Errorf("creating network: %v", err)
}
if eps, ok := networkStack.(*epsocket.Stack); ok {
stack.StackFromEnv = eps.Stack // FIXME
@@ -347,7 +347,7 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error {
return err
}
if info.Size() == 0 {
- return fmt.Errorf("error file was empty")
+ return fmt.Errorf("file cannot be empty")
}
// Load the state.
@@ -385,7 +385,7 @@ func (cm *containerManager) Restore(o *RestoreOpts, _ *struct{}) error {
// Tell the root container to start and wait for the result.
cm.startChan <- struct{}{}
if err := <-cm.startResultChan; err != nil {
- return fmt.Errorf("failed to start sandbox: %v", err)
+ return fmt.Errorf("starting sandbox: %v", err)
}
return nil