diff --git a/bin/compose b/bin/compose index 411098a..b1e2519 100755 --- a/bin/compose +++ b/bin/compose @@ -678,6 +678,10 @@ get_docker_compose_links() { done < <(get_compose_relations "$service") || return 1 merge_yaml_str "${deps[@]}" | tee "$cache_file" + if [ "${PIPESTATUS[0]}" != 0 ]; then + rm "$cache_file" + return 1 + fi } @@ -702,6 +706,10 @@ _get_docker_compose_opts() { if [ "$docker_compose_opts" ]; then yaml_key_val_str "$master_charm" "$docker_compose_opts" fi | tee "$cache_file" + if [ "${PIPESTATUS[0]}" != 0 ]; then + rm "$cache_file" + return 1 + fi } @@ -745,6 +753,11 @@ _get_docker_compose_service_mixin() { else echo "$links_yaml" fi | tee "$cache_file" + if [ "${PIPESTATUS[0]}" != 0 ]; then + rm "$cache_file" + return 1 + fi + } export -f _get_docker_compose_service_mixin @@ -820,6 +833,11 @@ _get_compose_service_def_cached () { service_def_base="charm: $service" value=$(echo "$docker_compose" | shyaml get-value "$service" 2>/dev/null) merge_yaml <(echo "$service_def_base") <(echo "$value") | tee "$cache_file" + if [ "${PIPESTATUS[0]}" != 0 ]; then + rm "$cache_file" + return 1 + fi + } export -f _get_compose_service_def_cached