public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
To: Henning Schild <henning.schild@siemens.com>, isar-users@googlegroups.com
Subject: Re: [PATCH 2/4] classes: simplify tag handling in container class
Date: Thu, 29 Jul 2021 10:49:20 +0200	[thread overview]
Message-ID: <5d95f9be-f68b-76df-5d50-a7cf92c5de3c@siemens.com> (raw)
In-Reply-To: <20210728152210.7089-3-henning.schild@siemens.com>


On 28/07/2021 17:22, Henning Schild wrote:
> 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.

I named it "full_tag" to remark the difference with the tag of the empty container image. But you're probably right, that simply "tag" is a better name.

Replacing the hard-coded tag is also meaningful.

>
> 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}"

  Silvano Cirujano Cuesta
-- 
Siemens AG, T RDA IOT SES-DE
Corporate Competence Center Embedded Linux


  reply	other threads:[~2021-07-29  8:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 15:22 [PATCH 0/4] Allow better control over container tags Henning Schild
2021-07-28 15:22 ` [PATCH 1/4] classes: make sure container extension can run multiple times Henning Schild
2021-07-29  8:29   ` Silvano Cirujano Cuesta
2021-07-28 15:22 ` [PATCH 2/4] classes: simplify tag handling in container class Henning Schild
2021-07-29  8:49   ` Silvano Cirujano Cuesta [this message]
2021-07-28 15:22 ` [PATCH 3/4] classes: allow more control over container image name and tag Henning Schild
2021-07-29 12:50   ` Silvano Cirujano Cuesta
2021-07-29 13:05     ` Henning Schild
2021-07-29 13:13       ` Silvano Cirujano Cuesta
2021-07-28 15:22 ` [PATCH 4/4] classes: fix comment in container-img class Henning Schild
2021-07-29 12:52   ` Silvano Cirujano Cuesta
2021-07-28 15:23 ` [PATCH 0/4] Allow better control over container tags Henning Schild
2021-07-29 12:58 ` 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=5d95f9be-f68b-76df-5d50-a7cf92c5de3c@siemens.com \
    --to=silvano.cirujano-cuesta@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.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