From 54c0290cda67b17d69aaf7c21b9808032165e7aa Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Mon, 1 Dec 2014 18:25:10 -0800 Subject: [PATCH] StorageDrivers should exit non-zero on error (closes #803) --- cmd/registry-storagedriver-filesystem/main.go | 6 +++++- cmd/registry-storagedriver-inmemory/main.go | 5 ++++- cmd/registry-storagedriver-s3/main.go | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cmd/registry-storagedriver-filesystem/main.go b/cmd/registry-storagedriver-filesystem/main.go index 8a5fc93cf..5ea1eb706 100644 --- a/cmd/registry-storagedriver-filesystem/main.go +++ b/cmd/registry-storagedriver-filesystem/main.go @@ -4,6 +4,8 @@ import ( "encoding/json" "os" + "github.com/Sirupsen/logrus" + "github.com/docker/docker-registry/storagedriver/filesystem" "github.com/docker/docker-registry/storagedriver/ipc" ) @@ -17,5 +19,7 @@ func main() { panic(err) } - ipc.StorageDriverServer(filesystem.FromParameters(parameters)) + if err := ipc.StorageDriverServer(filesystem.FromParameters(parameters)); err != nil { + logrus.Fatalln(err) + } } diff --git a/cmd/registry-storagedriver-inmemory/main.go b/cmd/registry-storagedriver-inmemory/main.go index 999c05d7f..77b1c5308 100644 --- a/cmd/registry-storagedriver-inmemory/main.go +++ b/cmd/registry-storagedriver-inmemory/main.go @@ -1,6 +1,7 @@ package main import ( + "github.com/Sirupsen/logrus" "github.com/docker/docker-registry/storagedriver/inmemory" "github.com/docker/docker-registry/storagedriver/ipc" ) @@ -8,5 +9,7 @@ import ( // An out-of-process inmemory driver, intended to be run by ipc.NewDriverClient // This exists primarily for example and testing purposes func main() { - ipc.StorageDriverServer(inmemory.New()) + if err := ipc.StorageDriverServer(inmemory.New()); err != nil { + logrus.Fatalln(err) + } } diff --git a/cmd/registry-storagedriver-s3/main.go b/cmd/registry-storagedriver-s3/main.go index aa5a11805..21192a0f3 100644 --- a/cmd/registry-storagedriver-s3/main.go +++ b/cmd/registry-storagedriver-s3/main.go @@ -4,6 +4,8 @@ import ( "encoding/json" "os" + "github.com/Sirupsen/logrus" + "github.com/docker/docker-registry/storagedriver/ipc" "github.com/docker/docker-registry/storagedriver/s3" ) @@ -22,5 +24,7 @@ func main() { panic(err) } - ipc.StorageDriverServer(driver) + if err := ipc.StorageDriverServer(driver); err != nil { + logrus.Fatalln(err) + } }