From 9575417b15a7d7568e0c090838b10a7280287bec Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Wed, 13 Apr 2016 17:56:29 +0800 Subject: [PATCH] Fix the upgrade issue when image id is the same When image id is the same, the container won't re-create with the latest image tag. Change-Id: I402ad275c388006248cb559851b01b0b963cf170 Closes-Bug: #1569723 --- ansible/library/kolla_docker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansible/library/kolla_docker.py b/ansible/library/kolla_docker.py index 844bb633ec..37b6450880 100644 --- a/ansible/library/kolla_docker.py +++ b/ansible/library/kolla_docker.py @@ -288,6 +288,7 @@ class DockerWorker(object): def compare_image(self, container_info=None): container_info = container_info or self.get_container_info() + parse_repository_tag = docker.utils.parse_repository_tag if not container_info: return True new_image = self.check_image() @@ -296,6 +297,11 @@ class DockerWorker(object): return True if new_image['Id'] != current_image: return True + # NOTE(Jeffrey4l) when new image and the current image have + # the same id, but the tag name different. + elif (parse_repository_tag(container_info['Config']['Image']) != + parse_repository_tag(self.params.get('image'))): + return True def compare_labels(self, container_info): new_labels = self.params.get('labels')