[BUILD] Fix docker mirror handling 94/127394/1
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>
Tue, 1 Mar 2022 11:34:28 +0000 (12:34 +0100)
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>
Tue, 1 Mar 2022 11:37:40 +0000 (12:37 +0100)
In case image originates from same repository that is used as a docker
mirror do not try to retag the image (to the same name which would
end with error)

Change-Id: I4c43315d5633e39a347492d2b2065bdddfead6fb
Issue-ID: INT-1429
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
build/download/docker_downloader.py

index c767aa9..9897325 100755 (executable)
@@ -164,9 +164,11 @@ class DockerDownloader(ConcurrentDownloader):
                 if (len(image_name_split) > 1) \
                    and (image_name_split[0].find(".")) >= 0 \
                    and not (image_name.startswith('docker.io/')) \
+                   and not (image_name.startswith(self._mirror)) \
                    and (image_name_split[0] not in self._mirror_exclude):
                     # if image originates from private registry and its name does not start with 'docker.io'
                     # and it does not originate from excluded registry
+                    # and docker mirror name differs from private registry name
                     # -> download image from docker mirror and retag it to its original name
                     mirrored_image_name = self._mirror + "/" + '/'.join(image_name_split[1:])
                     img = self._docker_client.images.pull(mirrored_image_name)