Browse Source

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.
test
Valentin Lab 6 years ago
parent
commit
0a1d885d2f
  1. 2
      bin/compose

2
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

Loading…
Cancel
Save