From 5352b6086eb39026c99698889928776c8921f6b1 Mon Sep 17 00:00:00 2001 From: Boris Gallet Date: Wed, 18 Dec 2024 17:38:02 +0100 Subject: [PATCH] fix: [compose-core] make charm resource work correctly when host charm store is not ``/srv/charm-store`` --- bin/compose-core | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/compose-core b/bin/compose-core index 5416e72..af1c889 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -4130,11 +4130,13 @@ _get_docker_compose_mixin_from_metadata_cached() { fi done < <(printf "%s" "$metadata" | shyaml get-values-0 "host-resources" 2>/dev/null) while read-0 resource; do - dest="$(charm.get_dir "$charm")/resources$resource" + charm_path="$(charm.get_dir "$charm")" + dest="$charm_path/resources$resource" + host_dest="$HOST_CHARM_STORE${dest#$CHARM_STORE}" if ! [ -e "$dest" ]; then - die "charm-resource: '$resource' does not exist (file: '$dest')." + die "charm-resource: '$resource' does not exist (file: '$host_dest')." fi - echo " - $dest:$resource:ro" + echo " - $host_dest:$resource:ro" done < <(echo "$metadata" | shyaml get-values-0 "charm-resources" 2>/dev/null) ) || return 1 if [ "$volumes" ]; then @@ -6405,4 +6407,4 @@ esac clean_unused_docker_compose || exit 1 -exit "$errlvl" \ No newline at end of file +exit "$errlvl"