[CORD-2542]
Don't remove build_tag if it's already been found on another image
Change-Id: I6e6106de5fe484e418f8a571acfab543d098679f
diff --git a/scripts/imagebuilder.py b/scripts/imagebuilder.py
index 6867f88..954c657 100755
--- a/scripts/imagebuilder.py
+++ b/scripts/imagebuilder.py
@@ -873,7 +873,9 @@
image.status = DI_EXISTS
else: # doesn't have good labels
- if has_build_tag:
+
+ # if it has a build_tag, and a good image hasn't already been tagged
+ if has_build_tag and (image.status != DI_EXISTS):
LOG.info(" Image %s has obsolete labels and"
" build_tag, remove" % pe_image['Id'])