fix agent hot-reload issue and added list agents endpoint

This commit is contained in:
yusing
2025-02-11 12:45:34 +08:00
parent 429a77de8e
commit 71619042fd
6 changed files with 47 additions and 16 deletions

View File

@@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"net/http"
"runtime/debug"
"sync"
"github.com/docker/cli/cli/connhelper"
@@ -88,7 +87,7 @@ func ConnectClient(host string) (*SharedClient, error) {
if agent.IsDockerHostAgent(host) {
cfg, ok := config.GetInstance().GetAgent(host)
if !ok {
return nil, fmt.Errorf("agent %q not found\n%s", host, debug.Stack())
panic(fmt.Errorf("agent %q not found", host))
}
opt = []client.Opt{
client.WithHost(agent.DockerHost),