fix: set connection timeouts + clean up bad contexts
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Closes coop-cloud/organising#205.
This commit is contained in:
@ -4,6 +4,7 @@ package client
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/sirupsen/logrus"
|
||||
@ -46,9 +47,11 @@ func New(contextName string) (*client.Client, error) {
|
||||
clientOpts = append(clientOpts, client.WithAPIVersionNegotiation())
|
||||
}
|
||||
|
||||
clientOpts = append(clientOpts, client.WithTimeout(3*time.Second))
|
||||
|
||||
cl, err := client.NewClientWithOpts(clientOpts...)
|
||||
if err != nil {
|
||||
logrus.Fatalf("unable to create Docker client: %s", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
logrus.Debugf("created client for '%s'", contextName)
|
||||
|
Reference in New Issue
Block a user