From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6989998000320806912 X-Received: by 2002:a19:760d:: with SMTP id c13mr11753435lff.88.1627905247731; Mon, 02 Aug 2021 04:54:07 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac2:4146:: with SMTP id c6ls409068lfi.2.gmail; Mon, 02 Aug 2021 04:54:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPOZZK7sBaixJyYbOHurlp57u3it7C8ls+aualdnHna0daJTTnKUQOdMX0s4l5lm5ODVx7 X-Received: by 2002:a05:6512:3d89:: with SMTP id k9mr11859672lfv.574.1627905246732; Mon, 02 Aug 2021 04:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627905246; cv=none; d=google.com; s=arc-20160816; b=dBmhlbkm9qh+j1SWPNt06yHcpCAeIdSwQoqXjkQLlegKQHizA356lwTY6eGDqU5dSi EAXS4Kz5AwvBdQpp3dI68Z3E6s9fFH+YC/VeyxbiP0e0LnMuBCyIV9gTw9B5yVvJ89zY mNVTVvANRRBTM0GGhJnaruJpqmzXVOTYXmC6XSDX2+aixkOltsfAvJqZwOMs6vfQLc8g L3eOU6c6J/IN6gid/o+QCQANCt84kdsx5V6fRtkFxhoTIHxP6kfWbJfVxkyFQlY38l47 tVajRiRHQ37zDVUkEvSTT0AhxqYqb+SCRx6x1Xmkf4orRkDvlt8q3G6sgmjnBa4uGoNl 20PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=TPTUhZN/fsHUH0f6RLjF+rxpmRgPUQsN9xCaial/l2k=; b=D4lJve4H792OwtDHACOO2yGDABw9+b55pvW3OVYWSYBEdhq9bIvx4dztRlA04gCFBb ejJE16DGeFm5gEf61Dt3GvIrsX7je9znBV1xPz8r57tcQ27atXMoqC/99bRi5GDXzgUD QRZL6Eb20RruiqeWi5npB2kDH2ddCZgxp0RDQrjQ+sx+ArlR3/r3UPOeurT/qG1WHVmT X5wZi2jX1Ol1J02j6pVyZsdLJSh/fIEku4CaGQ6AzZMNQWZ5td0ONKCNJsl2QF7wlrF+ cNc49bSgPXmxT2xouJAsQcrL5vdJpRbp4AD1hsz5eibz6F3lKNDJoywCRa7lZEn7bA6n 58vA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id j7si625907ljc.1.2021.08.02.04.54.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Aug 2021 04:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 172Bs5pC014966 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 2 Aug 2021 13:54:06 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.0.59]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 172Bs5fJ028005; Mon, 2 Aug 2021 13:54:05 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Silvano Cirujano Cuesta , Henning Schild Subject: [PATCH v3 2/4] classes: simplify tag handling in container class Date: Mon, 2 Aug 2021 13:54:02 +0200 Message-Id: <20210802115404.22707-3-henning.schild@siemens.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210802115404.22707-1-henning.schild@siemens.com> References: <20210802115404.22707-1-henning.schild@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: e3ZM9rBugWy+ Call the variable "tag" and use it in all places where "latest" was hardcoded. This prepares for another patch that will allow chosing something else than "latest" for a tag. Signed-off-by: Henning Schild --- meta/classes/image-container-extension.bbclass | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/meta/classes/image-container-extension.bbclass b/meta/classes/image-container-extension.bbclass index 6537fc693265..0e70ba9c1405 100644 --- a/meta/classes/image-container-extension.bbclass +++ b/meta/classes/image-container-extension.bbclass @@ -10,7 +10,7 @@ CONTAINER_FORMATS ?= "docker-archive" containerize_rootfs() { local cmd="/bin/dash" local empty_tag="empty" - local full_tag="latest" + local tag="latest" local oci_img_dir="${WORKDIR}/oci-image" local rootfs="$1" local rootfs_id="$2" @@ -33,7 +33,7 @@ containerize_rootfs() { # pack container image bbdebug 1 "pack container image" - sudo umoci repack --image "${oci_img_dir}:${full_tag}" \ + sudo umoci repack --image "${oci_img_dir}:${tag}" \ "${oci_img_dir}_unpacked" sudo umoci remove --image "${oci_img_dir}:${empty_tag}" sudo rm -rf "${oci_img_dir}_unpacked" @@ -49,14 +49,14 @@ containerize_rootfs() { case "${image_type}" in "docker-archive" | "oci-archive") if [ "${image_type}" = "oci-archive" ] ; then - target="${image_type}:${image_archive}:latest" + target="${image_type}:${image_archive}:${tag}" else - target="${image_type}:${image_archive}:${image_name}:latest" + target="${image_type}:${image_archive}:${image_name}:${tag}" fi rm -f "${image_archive}" "${image_archive}.xz" bbdebug 2 "Converting OCI image to ${image_type}" skopeo --insecure-policy copy \ - "oci:${oci_img_dir}:${full_tag}" "${target}" + "oci:${oci_img_dir}:${tag}" "${target}" bbdebug 2 "Compressing image" xz -T0 "${image_archive}" ;; @@ -69,8 +69,8 @@ containerize_rootfs() { die "Adding the container image to a container runtime (${image_type}) not supported if running from a container (e.g. 'kas-container')" fi skopeo --insecure-policy copy \ - "oci:${oci_img_dir}:${full_tag}" \ - "${image_type}:${image_name}:latest" + "oci:${oci_img_dir}:${tag}" \ + "${image_type}:${image_name}:${tag}" ;; *) die "Unsupported format for containerize_rootfs: ${image_type}" -- 2.31.1