From 162b84567fd822d43a777a6eab6d63f518854a46 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 19 Nov 2019 15:33:41 +0100 Subject: [PATCH] fix: try to pair before summoning Relations declared as auto summon was not trying to pair with an existing service before. Signed-off-by: Valentin Lab --- bin/compose-core | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/compose-core b/bin/compose-core index a9fd213..846bc25 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -2409,7 +2409,7 @@ get_all_relations () { auto=$(echo "$relation_def" | shyaml get-value auto pair 2>/dev/null) case "$auto" in - "pair") + "pair"|"summon") service_list=() array_read-0 service_list < <(array_keys_to_stdin services) providers=() @@ -2436,12 +2436,11 @@ get_all_relations () { "(> 1 provider)." continue else - : ## Do nothing + if [ "$auto" == "summon" ]; then + summon+=("$service" "$relation_name" "$relation_def") + fi fi ;; - "summon") - summon+=("$service" "$relation_name" "$relation_def") - ;; ""|null|disable|disabled) : ;;