Better format several errors

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu 2017-09-28 01:08:42 +00:00
parent 0e6e593481
commit 517f697f62
3 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ func main() {
glog.Exitf("Failed to init CRI containerd flags: %v", err)
}
glog.V(2).Infof("Run cri-containerd %+v", o)
glog.V(0).Infof("Run cri-containerd %+v", o)
if o.PrintVersion {
version.PrintVersion()
os.Exit(0)
@ -56,7 +56,7 @@ func main() {
glog.V(2).Infof("Run cri-containerd grpc server on socket %q", o.SocketPath)
s, err := server.NewCRIContainerdService(o.Config)
if err != nil {
glog.Exitf("Failed to create CRI containerd service %+v: %v", o, err)
glog.Exitf("Failed to create CRI containerd service: %v", err)
}
// Use interrupt handler to make sure the server to be stopped properly.
// Pass in non-empty final function to avoid os.Exit(1). We expect `Run`

View File

@ -155,5 +155,5 @@ func (RealOS) DeviceUUID(device string) (string, error) {
return file.Name(), nil
}
}
return "", fmt.Errorf("device not found")
return "", fmt.Errorf("device %q not found", device)
}

View File

@ -141,7 +141,7 @@ func NewCRIContainerdService(config options.Config) (CRIContainerdService, error
imageFSPath := imageFSPath(config.ContainerdConfig.RootDir, config.ContainerdConfig.Snapshotter)
c.imageFSUUID, err = c.getDeviceUUID(imageFSPath)
if err != nil {
return nil, fmt.Errorf("failed to get imagefs uuid: %v", err)
return nil, fmt.Errorf("failed to get imagefs uuid of %q: %v", imageFSPath, err)
}
c.netPlugin, err = ocicni.InitCNI(config.NetworkPluginConfDir, config.NetworkPluginBinDir)