Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1369 from vieux/fix_various_issues
Browse files Browse the repository at this point in the history
Fix various issues
  • Loading branch information
vieux committed Nov 3, 2015
2 parents 830c612 + c286a18 commit 087e245
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions cluster/engine.go
Expand Up @@ -128,6 +128,9 @@ func (e *Engine) ConnectWithClient(client dockerclient.Client) error {
return err
}

// Start monitoring events from the engine.
e.client.StartMonitorEvents(e.handler, nil)

// Force a state update before returning.
if err := e.RefreshContainers(true); err != nil {
return err
Expand All @@ -144,8 +147,6 @@ func (e *Engine) ConnectWithClient(client dockerclient.Client) error {
// Start the update loop.
go e.refreshLoop()

// Start monitoring events from the engine.
e.client.StartMonitorEvents(e.handler, nil)
e.emitEvent("engine_connect")

return nil
Expand Down Expand Up @@ -218,7 +219,10 @@ func (e *Engine) updateSpecs() error {

// RemoveImage deletes an image from the engine.
func (e *Engine) RemoveImage(image *Image, name string, force bool) ([]*dockerclient.ImageDelete, error) {
return e.client.RemoveImage(name, force)
array, err := e.client.RemoveImage(name, force)
e.RefreshImages()
return array, err

}

// RemoveNetwork deletes a network from the engine.
Expand Down Expand Up @@ -521,6 +525,7 @@ func (e *Engine) Create(config *ContainerConfig, name string, pullImage bool) (*
// Register the container immediately while waiting for a state refresh.
// Force a state refresh to pick up the newly created container.
e.refreshContainer(id, true)
e.RefreshVolumes()
e.RefreshNetworks()

e.RLock()
Expand Down
2 changes: 1 addition & 1 deletion test/integration/api/network.bats
Expand Up @@ -28,7 +28,7 @@ function teardown() {
run docker_swarm network inspect node-0/bridge
[[ "${output}" != *"\"Containers\": {}"* ]]

diff <(docker_swarm network inspect node-0/bridge) <(docker_host -H ${HOSTS[0]} network inspect bridge)
diff <(docker_swarm network inspect node-0/bridge) <(docker -H ${HOSTS[0]} network inspect bridge)
}

@test "docker network create" {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/api/run.bats
Expand Up @@ -107,7 +107,7 @@ function teardown() {
[[ "${output}" == *"node-0/test_container"* ]]
}

@test "docker run - reschedule with soft-image-affinity(have node constraint))" {
@test "docker run - reschedule with soft-image-affinity and node constraint" {
start_docker_with_busybox 1
start_docker 1

Expand Down

0 comments on commit 087e245

Please sign in to comment.