diff --git a/pkg/crt/docker/dockerclient/client.go b/pkg/crt/docker/dockerclient/client.go index 86e3fa60..635fe4e2 100644 --- a/pkg/crt/docker/dockerclient/client.go +++ b/pkg/crt/docker/dockerclient/client.go @@ -8,7 +8,7 @@ import ( "path/filepath" "strings" - "github.com/fsouza/go-dockerclient" + docker "github.com/fsouza/go-dockerclient" log "github.com/sirupsen/logrus" "github.com/mintoolkit/mint/pkg/app/master/config" @@ -210,8 +210,12 @@ func New(config *config.DockerClient) (*docker.Client, error) { //so we need to lookup the context first to extract its connection info var currentDockerContext string if dcf, err := ReadConfigFile(ConfigFilePath()); err == nil { - currentDockerContext = dcf.CurrentContext - log.Debugf("dockerclient.New: currentDockerContext - '%s'", currentDockerContext) + if dcf == nil { + log.Debug("dockerclient.New: No config file.") + } else { + currentDockerContext = dcf.CurrentContext + log.Debugf("dockerclient.New: currentDockerContext - '%s'", currentDockerContext) + } } else { log.Debugf("dockerclient.New: ReadConfigFile error - %v", err) }