When providing the KAS_CONTAINER_IMAGE explicitly, do not append any
modifiers (like the distribution / tag / ...) but just take the string
as-is. This is also aligns the semantics with the documentation.
The impact of this change is quite minimal, as the same behavior can
also be achived by unsetting all KAS_CONTAINER_* variables before
calling kas-container. However, we already see a downstream pattern
where the KAS_CONTAINER_IMAGE_DISTRO is set directly in a copy of the
kas-container script to pin it to a distribution usable for the
downstream project. In this case it previously was impossible to
explicitly set a KAS_CONTAINER_IMAGE as the distro was always appended.
Fixes: b99dd31b8 ("kas-container: allow to select specific image ...")
Signed-off-by: Felix Moessbauer <
felix.mo...@siemens.com>
---
kas-container | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kas-container b/kas-container
index 2241c3136..1e7834353 100755
--- a/kas-container
+++ b/kas-container
@@ -294,6 +294,9 @@ trap kas_container_cleanup EXIT INT TERM
set_container_image_var()
{
+ # if the image is explicitly set, use that
+ [ -n "${KAS_CONTAINER_IMAGE}" ] && return
+
KAS_IMAGE_VERSION="${KAS_IMAGE_VERSION:-${KAS_IMAGE_VERSION_DEFAULT}}"
KAS_CONTAINER_IMAGE_DISTRO="${KAS_CONTAINER_IMAGE_DISTRO:-${KAS_CONTAINER_IMAGE_DISTRO_DEFAULT}}"
KAS_CONTAINER_IMAGE_NAME="${KAS_CONTAINER_IMAGE_NAME:-${KAS_CONTAINER_IMAGE_NAME_DEFAULT}}"
--
2.53.0