public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>,
	Henning Schild <henning.schild@siemens.com>
Subject: [PATCH v5 2/5] classes: simplify tag handling in container class
Date: Thu,  5 Aug 2021 18:09:46 +0200	[thread overview]
Message-ID: <20210805160949.14790-3-henning.schild@siemens.com> (raw)
In-Reply-To: <20210805160949.14790-1-henning.schild@siemens.com>

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 <henning.schild@siemens.com>
---
 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


  parent reply	other threads:[~2021-08-05 16:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 16:09 [PATCH v5 0/5] Allow better control over container tags Henning Schild
2021-08-05 16:09 ` [PATCH v5 1/5] classes: make sure container extension can run multiple times Henning Schild
2021-08-05 16:09 ` Henning Schild [this message]
2021-08-05 16:09 ` [PATCH v5 3/5] classes: allow more control over container image name and tag Henning Schild
2021-08-18 16:19   ` Anton Mikanovich
2021-08-18 16:22     ` Jan Kiszka
2021-12-14 21:11       ` Henning Schild
2021-12-15  6:49         ` Schmidt, Adriaan
2021-12-15 16:17     ` Henning Schild
2021-08-05 16:09 ` [PATCH v5 4/5] classes: rename CONTAINER_FORMATS to CONTAINER_IMAGE_FORMATS Henning Schild
2021-08-05 16:09 ` [PATCH v5 5/5] classes: fix comment in container-img class Henning Schild
2021-08-05 16:12 ` [PATCH v5 0/5] Allow better control over container tags Silvano Cirujano Cuesta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210805160949.14790-3-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=silvano.cirujano-cuesta@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox