From 0a1d885d2fefd14b9165c0c30fb0f1c0f0b650a7 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Thu, 15 Nov 2018 16:53:57 +0100 Subject: [PATCH] fix: improper failure if using an empty service definition in ``compose.yml`` An empty definition is useful if you need the service to be selected as a default service when using ``compose up`` with no argument, and you don't have anything to configure in the given service. --- bin/compose | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/compose b/bin/compose index 75fc5b0..b9d6930 100755 --- a/bin/compose +++ b/bin/compose @@ -987,6 +987,7 @@ _get_compose_service_def_cached () { return 0 fi value=$(echo "$docker_compose" | shyaml get-value "$service" 2>/dev/null) + [ "$value" == None ] && value="" if ! echo "$value" | shyaml get-value "charm" >/dev/null 2>&1; then if charm.exists "$service"; then value=$(merge_yaml <(echo "charm: $service") <(echo "$value")) || { @@ -2094,6 +2095,7 @@ _get_docker_compose_mixin_from_metadata_cached() { fi image=$(echo "$metadata" | shyaml get-value "docker-image" 2>/dev/null) + [ "$image" == "None" ] && image="" image_or_build_statement= if [ "$image" ]; then if [ "$subordinate" ]; then