fix: set connection timeouts + clean up bad contexts
All checks were successful
continuous-integration/drone/push Build is passing

Closes coop-cloud/organising#205.
This commit is contained in:
2021-10-18 10:48:43 +02:00
parent 9dfbd21c61
commit d1e42752e2
5 changed files with 351 additions and 2 deletions

View File

@ -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)