update docker sdk to v25 (#455)
* update docker sdk to latest * Refactor Docker plugin to use latest Docker SDK
This commit is contained in:
parent
08d0e23d60
commit
304dd72a53
3 changed files with 71 additions and 28 deletions
|
|
@ -9,7 +9,7 @@ import (
|
|||
"fmt"
|
||||
"net"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
"github.com/docker/docker/client"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
|
@ -43,7 +43,7 @@ func (p *plugin) listPipes() ([]pipe, error) {
|
|||
// filter := filters.NewArgs()
|
||||
// filter.Add("label", fmt.Sprintf("sshpiper.username=%v", username))
|
||||
|
||||
containers, err := p.dockerCli.ContainerList(context.Background(), types.ContainerListOptions{
|
||||
containers, err := p.dockerCli.ContainerList(context.Background(), container.ListOptions{
|
||||
// Filters: filter,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
@ -91,7 +91,7 @@ func (p *plugin) listPipes() ([]pipe, error) {
|
|||
return nil, fmt.Errorf("multiple networks found for container %v, please specify sshpiper.network", c.ID)
|
||||
}
|
||||
|
||||
net, err := p.dockerCli.NetworkInspect(context.Background(), netname, types.NetworkInspectOptions{})
|
||||
net, err := p.dockerCli.NetworkInspect(context.Background(), netname, network.InspectOptions{})
|
||||
if err != nil {
|
||||
log.Warnf("cannot list network %v for container %v: %v", netname, c.ID, err)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue