From 929e1692dbcbcecc2537204c1071306c2ad02e69 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 9 Dec 2024 10:13:53 +0100 Subject: [PATCH] fix: [compose-core] do not quote dots in the final ``docker-compose.yml`` --- bin/compose-core | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/compose-core b/bin/compose-core index 0dddb71..a63ace8 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -1776,8 +1776,7 @@ service_ensure_image_ready() { local service="$1" \ cache_file="$CACHEDIR/$FUNCNAME.cache.$1.$(H "$COMBINED_HASH" "$(cat "$_CURRENT_DOCKER_COMPOSE")")" \ master_service service_def service_image service_build service_dockerfile image \ - specified_image specified_image_id charm_image_name hash \ - service_quoted + specified_image specified_image_id charm_image_name hash if [ -e "$cache_file" ]; then #debug "$FUNCNAME: cache hit ($*)" @@ -1812,7 +1811,6 @@ service_ensure_image_ready() { err "Could not get docker-compose service definition for $DARKYELLOW$service$NORMAL." return 1 } - local service_quoted=${service//./\\.} if specified_image=$(e "$service_def" | shyaml get-value image 2>/dev/null); then if [[ "$specified_image" == "$charm_image_name:"* ]]; then ## Assume we already did the change @@ -1842,7 +1840,7 @@ service_ensure_image_ready() { type=fetch ## replace image by charm image - yq -i ".services.[\"${service_quoted}\"].image = \"${charm_image_name}:${hash}\"" \ + yq -i ".services.[\"${service}\"].image = \"${charm_image_name}:${hash}\"" \ "$_CURRENT_DOCKER_COMPOSE" || return 1 else @@ -1857,8 +1855,8 @@ service_ensure_image_ready() { hash=$(get_build_hash "$src") || return 1 type=build ## delete build key from service_def and add image to charm_image_name - yq -i "del(.services.[\"${service_quoted}\"].build) | - .services.[\"${service_quoted}\"].image = \"${charm_image_name}:${hash}\"" \ + yq -i "del(.services.[\"${service}\"].build) | + .services.[\"${service}\"].image = \"${charm_image_name}:${hash}\"" \ "$_CURRENT_DOCKER_COMPOSE" || return 1 fi