mirror of https://github.com/docker/docs.git
parent
bc17fbd6f7
commit
af05bfd0ba
|
@ -5,6 +5,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/swarm/cluster"
|
||||
"github.com/samalba/dockerclient"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
@ -19,6 +20,7 @@ func (fw *FakeWriter) Write(p []byte) (n int, err error) {
|
|||
|
||||
type FakeNode struct{}
|
||||
|
||||
func (fn *FakeNode) DockerClient() dockerclient.Client { return nil }
|
||||
func (fn *FakeNode) ID() string { return "node_id" }
|
||||
func (fn *FakeNode) Name() string { return "node_name" }
|
||||
func (fn *FakeNode) IP() string { return "node_ip" }
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package filter
|
||||
|
||||
import "github.com/docker/swarm/cluster"
|
||||
import (
|
||||
"github.com/docker/swarm/cluster"
|
||||
"github.com/samalba/dockerclient"
|
||||
)
|
||||
|
||||
type FakeNode struct {
|
||||
id string
|
||||
|
@ -11,11 +14,12 @@ type FakeNode struct {
|
|||
labels map[string]string
|
||||
}
|
||||
|
||||
func (fn *FakeNode) ID() string { return fn.id }
|
||||
func (fn *FakeNode) Name() string { return fn.name }
|
||||
func (fn *FakeNode) IP() string { return "" }
|
||||
func (fn *FakeNode) Addr() string { return fn.addr }
|
||||
func (fn *FakeNode) Images() []*cluster.Image { return fn.images }
|
||||
func (fn *FakeNode) DockerClient() dockerclient.Client { return nil }
|
||||
func (fn *FakeNode) ID() string { return fn.id }
|
||||
func (fn *FakeNode) Name() string { return fn.name }
|
||||
func (fn *FakeNode) IP() string { return "" }
|
||||
func (fn *FakeNode) Addr() string { return fn.addr }
|
||||
func (fn *FakeNode) Images() []*cluster.Image { return fn.images }
|
||||
func (fn *FakeNode) Image(id string) *cluster.Image {
|
||||
for _, image := range fn.images {
|
||||
if image.Id == id {
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"errors"
|
||||
|
||||
"github.com/docker/swarm/cluster"
|
||||
"github.com/samalba/dockerclient"
|
||||
)
|
||||
|
||||
type FakeNode struct {
|
||||
|
@ -17,6 +18,7 @@ type FakeNode struct {
|
|||
containers []*cluster.Container
|
||||
}
|
||||
|
||||
func (fn *FakeNode) DockerClient() dockerclient.Client { return nil }
|
||||
func (fn *FakeNode) ID() string { return fn.id }
|
||||
func (fn *FakeNode) Name() string { return fn.name }
|
||||
func (fn *FakeNode) IP() string { return "" }
|
||||
|
|
Loading…
Reference in New Issue