Browse Source

fix: ``subordinate`` charm should not be launched

test1
Valentin Lab 6 years ago
parent
commit
b690c921f4
  1. 15
      bin/compose-core

15
bin/compose-core

@ -2874,7 +2874,7 @@ _get_master_service_for_service_cached () {
fi fi
## Action provided by relation ? ## Action provided by relation ?
container_relation=$(_get_container_relation "$metadata")
container_relation=$(_get_container_relation "$metadata") || exit 1
read-0 target_service _ _ < <(get_service_relation "$service" "$container_relation") read-0 target_service _ _ < <(get_service_relation "$service" "$container_relation")
if [ -z "$target_service" ]; then if [ -z "$target_service" ]; then
err "Couldn't find ${WHITE}relations.${container_relation}${NORMAL} in" \ err "Couldn't find ${WHITE}relations.${container_relation}${NORMAL} in" \
@ -4061,12 +4061,15 @@ get_all_relations "${services_args[@]}" >/dev/null || exit 1
if [ "$is_docker_compose_action" -a "${#services_args[@]}" -gt 0 ]; then if [ "$is_docker_compose_action" -a "${#services_args[@]}" -gt 0 ]; then
services=($(get_master_services "${services_args[@]}")) || exit 1 services=($(get_master_services "${services_args[@]}")) || exit 1
if [ "$action" == "up" ]; then if [ "$action" == "up" ]; then
## remove run-once
declare -A seen
for service in $(get_ordered_service_dependencies "${services_args[@]}"); do for service in $(get_ordered_service_dependencies "${services_args[@]}"); do
type="$(get_service_type "$service")" || exit 1
if [ "$type" != "run-once" ]; then
action_posargs+=("$service")
fi
mservice=$(get_master_service_for_service "$service")
[ "${seen[$mservice]}" ] && continue
type="$(get_service_type "$mservice")" || exit 1
## remove run-once
[ "$type" == "run-once" ] && continue
seen[$mservice]=1
action_posargs+=("$mservice")
done done
else else
action_posargs+=("${services[@]}") action_posargs+=("${services[@]}")

Loading…
Cancel
Save