feat: agent as docker provider, drop / reload routes when docker connection state changed, refactor

This commit is contained in:
yusing
2025-03-28 08:02:29 +08:00
parent 8c9a2b022b
commit c6f65ba69f
7 changed files with 183 additions and 114 deletions

View File

@@ -5,7 +5,6 @@ import (
"errors"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
)
@@ -22,8 +21,8 @@ var listOptions = container.ListOptions{
All: true,
}
func ListContainers(clientHost string) ([]types.Container, error) {
dockerClient, err := ConnectClient(clientHost)
func ListContainers(clientHost string) ([]container.Summary, error) {
dockerClient, err := NewClient(clientHost)
if err != nil {
return nil, err
}