Fix docker client calls

This commit is contained in:
Abdulrahman Solanke 2023-05-19 01:20:50 +01:00
parent ad6ccde1bb
commit 03b903a00d
3 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ func (c *DaemonCmd) Run(args []string) int {
go func() {
counter := 0
ctx := context.Background()
dockerClient, _ := client.NewEnvClient()
dockerClient, _ := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
for {
<-timer1.C

View File

@ -27,7 +27,7 @@ func Autodetect(core *Core) error {
func autoDetectSwarmMode(c *Core) {
ctx := context.Background()
dockerClient, err := client.NewEnvClient()
dockerClient, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
if err != nil {
logrus.WithField("error", err).Debug("Problem communication with Docker")
return

View File

@ -19,7 +19,7 @@ type SwarmProvider struct {
func NewSwarmProvider(c map[string]string) (autoscaler.Provider, error) {
var p autoscaler.Provider
client, err := docker.NewEnvClient()
client, err := docker.NewClientWithOpts(docker.FromEnv, docker.WithAPIVersionNegotiation())
if err != nil {
logrus.WithField("error", err).Warn("problem to communicate with docker")
return p, err