From nobody Mon Feb 9 11:47:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190557; cv=none; d=zohomail.com; s=zohoarc; b=F4LJK/l+lM/O6Zidc6EfrOJXEse5lycZMvuGXam6/hlqhQPo0ZZJvrmN1q16LKr1YoWUcLpG1ygy63auJY+awJtSKKPmu8P0zNZpHbBYG/XNHTEm7uBM6VuC0APuKfemFm7ChVClo3++PaZBplQ359mXJMdlpl5uf37VR0ovqbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190557; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/IRj2DFvL4h1f18qbJPeVNChbkd7OVSiejOjIXoB+t0=; b=LGgk4OqwqWIhcu8h5Ipj982ptfRCy1drz+bkXA4FkBtzs9HezymgsFXMDLTKpAchWAUBS3qOTPkl56cC6ya+mUccz1IhuQQyDAXDWTyq5pQ/cxAtcPTRF3Eht/aA6SbDRVp35C8NYkvtrVvJYcXuyfFfHvEZutYpONjM1sE4IDQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1619190557833154.9464053702867; Fri, 23 Apr 2021 08:09:17 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-546-Z8MZOnjZM8WLJ8LBWUX6Pg-1; Fri, 23 Apr 2021 11:08:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F0798189D3; Fri, 23 Apr 2021 15:08:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1DEF60BE5; Fri, 23 Apr 2021 15:08:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BC5DF1806D2D; Fri, 23 Apr 2021 15:08:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3MYY031713 for ; Fri, 23 Apr 2021 11:03:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C7FF10027A5; Fri, 23 Apr 2021 15:03:22 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD8FC10016DB for ; Fri, 23 Apr 2021 15:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190556; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/IRj2DFvL4h1f18qbJPeVNChbkd7OVSiejOjIXoB+t0=; b=L6n8GjxJBvH+baRmBJboVVls1qUbreaX22VE//kcnhVA7xxwMhzeoG+9/6FzAe4eLq/J+k Op37pEtgvjs0ThT+IFRBvIbAaoPbodlAUWJfo4134Dk4KI2Kfoj6jBC0aHp6bAOP0ztVjB E5JrCV4kddw+LWgbZBP2hGR9gsDzsc0= X-MC-Unique: Z8MZOnjZM8WLJ8LBWUX6Pg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 05/11] ci: util: Add new get_registry_images() function Date: Fri, 23 Apr 2021 17:03:02 +0200 Message-Id: <20210423150308.346189-6-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- ci/util.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ci/util.py b/ci/util.py index b6a99ce9c0..b314ebd078 100644 --- a/ci/util.py +++ b/ci/util.py @@ -72,6 +72,34 @@ def get_image_info(image_name: str) -> Dict[str, str]: return {"distro": distro, "cross": cross} =20 =20 +def get_registry_images(registry_uri: str) -> Dict[str, List[str]]: + """ + List all container images that are currently available in the + given GitLab project. + + The returned dictionary contains an entry for each available + distro, with its associated value being a (possibly empty) list + of cross-building architectures it supports. + + :param uri: URI pointing to a GitLab instance's image registry + :return: information about container images + """ + + registry_images =3D get_registry_images_raw(registry_uri) + + # Parse the names of all images found on the registry and + # organize them by distro + images =3D {} + for image in registry_images: + info =3D get_image_info(image["name"]) + if info["distro"] not in images: + images[info["distro"]] =3D [] + if info["cross"]: + images[info["distro"]].append(info["cross"]) + + return images + + def get_registry_stale_images(registry_uri: str, supported_distros: List[str]) -> Dict[str, i= nt]: """ --=20 2.26.3