Check only gcr.io for digests, and then push to all registries at the end
@@ -100,17 +100,16 @@ class TagReconciler:
registries = project.get('additional_registries', [])
registries.append(default_registry)
- for registry in registries:
- full_repo = os.path.join(registry, project['repository'])
+ default_repo = os.path.join(default_registry,
+ project['repository'])
for image in project['images']:
- digest = self.get_digest_from_prefix(full_repo,
+ digest = self.get_digest_from_prefix(default_repo,
image['digest'])
- full_digest = full_repo + '@sha256:' + digest
- full_tag = full_repo + ':' + image['tag']
+ default_digest = default_repo + '@sha256:' + digest
- name = docker_name.Digest(full_digest)
+ name = docker_name.Digest(default_digest)
creds = docker_creds.DefaultKeychain.Resolve(name)
transport = transport_pool.Http(httplib2.Http)
@@ -118,7 +117,7 @@ class TagReconciler:
transport) as img:
if not img.exists():
logging.debug('Could not retrieve ' +
- '{0}'.format(full_digest))
+ '{0}'.format(default_digest))
return
existing_tags = img.tags()
@@ -138,9 +137,14 @@ class TagReconciler:
digest, image['tag'])
continue
+ for registry in registries:
+ full_repo = os.path.join(registry,
+ project['repository'])
+ full_digest = full_repo + '@sha256:' + digest
+ full_tag = full_repo + ':' + image['tag']
self.add_tags(full_digest, full_tag, dry_run)
- logging.debug(self.get_existing_tags(full_repo, digest))
+ logging.debug(self.get_existing_tags(default_repo, digest))
def main():
