forked from toolshed/abra
refactor: moved all fatal errors to logrus
This will allow us to test commands that would normally exit
This commit is contained in:
@ -2,7 +2,6 @@ package client
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
@ -12,6 +11,7 @@ import (
|
||||
dCliContextStore "github.com/docker/cli/cli/context/store"
|
||||
dClient "github.com/docker/docker/client"
|
||||
"github.com/moby/term"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func NewClientWithContext(contextURL string) *dClient.Client {
|
||||
@ -44,8 +44,7 @@ func NewClientWithContext(contextURL string) *dClient.Client {
|
||||
cl, err := dClient.NewClientWithOpts(clientOpts...)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("Unable to create docker client")
|
||||
panic(err)
|
||||
logrus.Fatalf("unable to create Docker client: %s", err)
|
||||
}
|
||||
return cl
|
||||
}
|
||||
|
Reference in New Issue
Block a user