def get_repositories_and_digests(self):
        """
        Returns a map of images to their repositories and a map of media types to each digest

        it creates a map of images to digests, which is need to create the image->repository
        map and uses the same loop structure as media_types->digest, but the image->digest
        map isn't needed after we have the image->repository map and can be discarded.
        """
        digests = {}  # image -> digests
        typed_digests = {}  # media_type -> digests
        for registry in self.workflow.push_conf.docker_registries:
            for image in self.workflow.tag_conf.images:
                image_str = image.to_str()
                if image_str in registry.digests:
                    image_digests = registry.digests[image_str]
                    if self.report_multiple_digests and get_pulp(self.workflow, None):
                        digest_list = [digest for digest in (image_digests.v1,
                                                             image_digests.v2)
                                       if digest]
                    else:
                        digest_list = [self.select_digest(image_digests)]
                    digests[image.to_str(registry=False)] = digest_list
                    for digest_version in image_digests.content_type:
                        if digest_version not in image_digests:
                            continue
                        if not get_pulp(self.workflow, None) and digest_version == 'v1':
                            continue
                        digest_type = get_manifest_media_type(digest_version)
                        typed_digests[digest_type] = image_digests[digest_version]

        if self.workflow.push_conf.pulp_registries:
            # If pulp was used, only report pulp images
            registries = self.workflow.push_conf.pulp_registries
        else:
            # Otherwise report all the images we pushed
            registries = self.workflow.push_conf.all_registries
        repositories = []
        for registry in registries:
            image = self.pullspec_image.copy()
            image.registry = registry.uri
            pullspec = image.to_str()

            repositories.append(pullspec)

            digest_list = digests.get(image.to_str(registry=False), ())
            for digest in digest_list:
                digest_pullspec = image.to_str(tag=False) + "@" + digest
                repositories.append(digest_pullspec)

        return repositories, typed_digests
Returns a map of images to their repositories and a map of media types to each digest

        it creates a map of images to digests, which is need to create the image->repository
        map and uses the same loop structure as media_types->digest, but the image->digest
        map isn't needed after we have the image->repository map and can be discarded.