mirror of https://github.com/docker/docs.git
fix with the new dockerclient version
This commit is contained in:
parent
6d8ecbeff6
commit
9e60bdd877
2
node.go
2
node.go
|
@ -108,7 +108,7 @@ func (n *Node) updateSpecs() error {
|
||||||
|
|
||||||
// Refresh the list and status of containers running on the node.
|
// Refresh the list and status of containers running on the node.
|
||||||
func (n *Node) updateState() error {
|
func (n *Node) updateState() error {
|
||||||
containers, err := n.client.ListContainers(true)
|
containers, err := n.client.ListContainers(true, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ func TestNodeSpecs(t *testing.T) {
|
||||||
|
|
||||||
client := dockerclient.NewMockClient()
|
client := dockerclient.NewMockClient()
|
||||||
client.On("Info").Return(mockInfo, nil)
|
client.On("Info").Return(mockInfo, nil)
|
||||||
client.On("ListContainers", true).Return([]dockerclient.Container{}, nil)
|
client.On("ListContainers", true, false).Return([]dockerclient.Container{}, nil)
|
||||||
client.On("StartMonitorEvents", mock.Anything, mock.Anything).Return()
|
client.On("StartMonitorEvents", mock.Anything, mock.Anything).Return()
|
||||||
|
|
||||||
assert.NoError(t, node.connectClient(client))
|
assert.NoError(t, node.connectClient(client))
|
||||||
|
@ -66,8 +66,8 @@ func TestNodeState(t *testing.T) {
|
||||||
client.On("StartMonitorEvents", mock.Anything, mock.Anything).Return()
|
client.On("StartMonitorEvents", mock.Anything, mock.Anything).Return()
|
||||||
|
|
||||||
// The client will return one container at first, then a second one will appear.
|
// The client will return one container at first, then a second one will appear.
|
||||||
client.On("ListContainers", true).Return([]dockerclient.Container{{Id: "one"}}, nil).Once()
|
client.On("ListContainers", true, false).Return([]dockerclient.Container{{Id: "one"}}, nil).Once()
|
||||||
client.On("ListContainers", true).Return([]dockerclient.Container{{Id: "one"}, {Id: "two"}}, nil).Once()
|
client.On("ListContainers", true, false).Return([]dockerclient.Container{{Id: "one"}, {Id: "two"}}, nil).Once()
|
||||||
|
|
||||||
assert.NoError(t, node.connectClient(client))
|
assert.NoError(t, node.connectClient(client))
|
||||||
assert.True(t, node.IsConnected())
|
assert.True(t, node.IsConnected())
|
||||||
|
|
Loading…
Reference in New Issue