Merge pull request #1565 from jimmyxian/fresh-image-when-commit

fresh image when receive commit event
This commit is contained in:
Alexandre Beslic 2016-01-13 12:01:09 -08:00
commit d21748699d
2 changed files with 11 additions and 1 deletions

View File

@ -879,7 +879,7 @@ func (e *Engine) String() string {
func (e *Engine) handler(ev *dockerclient.Event, _ chan error, args ...interface{}) {
// Something changed - refresh our internal state.
switch ev.Status {
case "pull", "untag", "delete":
case "pull", "untag", "delete", "commit":
// These events refer to images so there's no need to update
// containers.
e.RefreshImages()

View File

@ -68,3 +68,13 @@ function teardown() {
[ "${#lines[@]}" -eq 2 ]
[[ "${lines[1]}" == *"testimage"* ]]
}
@test "docker images - after commit on engine side" {
start_docker_with_busybox 2
swarm_manage
docker -H ${HOSTS[0]} run -d --name test_container busybox sleep 500
docker -H ${HOSTS[0]} commit test_container testimage
retry 5 1 eval "docker_swarm images | grep 'testimage'"
}