From e3d08f9fc6c1e8a9a339d5001cfe3cc8dd0da59a Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 9 Jan 2019 14:42:45 +0100 Subject: [PATCH] new: ``default-options`` in charm root is loaded as default options of service --- bin/compose-core | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/compose-core b/bin/compose-core index f734605..848e1e2 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -1144,6 +1144,11 @@ get_compose_service_def () { [ -z "$service" ] && print_syntax_error "Missing service as first argument." docker_compose=$(get_compose_yml_content) || return 1 result=$(_get_compose_service_def_cached "$service" "$docker_compose") || return 1 + charm=$(echo "$result" |shyaml get-value charm 2>/dev/null) || return 1 + if default_options=$(printf "%s" "$metadata" | shyaml -y -q get-value default-options); then + default_options=$(yaml_key_val_str "options" "$default_options") || return 1 + result=$(merge_yaml_str "$default_options" "$result") || return 1 + fi echo "$result" | tee "$cache_file" || return 1 } export -f get_compose_service_def