|
@ -1162,18 +1162,8 @@ host_resource_get_git-sub() { |
|
|
export -f host_resource_get_git-sub |
|
|
export -f host_resource_get_git-sub |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup_host_resources () { |
|
|
|
|
|
local services="$1" action="$2" loaded location cfg |
|
|
|
|
|
|
|
|
|
|
|
declare -A loaded |
|
|
|
|
|
for service in $services; do |
|
|
|
|
|
for subservice in $(get_ordered_service_dependencies "$service"); do |
|
|
|
|
|
if [ "${loaded[$subservice]}" ]; then |
|
|
|
|
|
## Prevent double inclusion of same service if this |
|
|
|
|
|
## service is deps of two or more of your |
|
|
|
|
|
## requirements. |
|
|
|
|
|
continue |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
setup_host_resource () { |
|
|
|
|
|
local service="$1" service_def location get cfg |
|
|
|
|
|
|
|
|
service_def=$(get_compose_service_def "$subservice") || return 1 |
|
|
service_def=$(get_compose_service_def "$subservice") || return 1 |
|
|
while read-0 location cfg; do |
|
|
while read-0 location cfg; do |
|
@ -1195,12 +1185,29 @@ setup_host_resources () { |
|
|
fi |
|
|
fi |
|
|
host_resource_get "$location" "$get" || return 1 |
|
|
host_resource_get "$location" "$get" || return 1 |
|
|
done < <(echo "$service_def" | shyaml key-values-0 host-resources 2>/dev/null) |
|
|
done < <(echo "$service_def" | shyaml key-values-0 host-resources 2>/dev/null) |
|
|
|
|
|
} |
|
|
|
|
|
export -f setup_host_resource |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup_host_resources () { |
|
|
|
|
|
local services="$1" loaded |
|
|
|
|
|
|
|
|
|
|
|
declare -A loaded |
|
|
|
|
|
for service in $services; do |
|
|
|
|
|
for subservice in $(get_ordered_service_dependencies "$service"); do |
|
|
|
|
|
if [ "${loaded[$subservice]}" ]; then |
|
|
|
|
|
## Prevent double inclusion of same service if this |
|
|
|
|
|
## service is deps of two or more of your |
|
|
|
|
|
## requirements. |
|
|
|
|
|
continue |
|
|
|
|
|
fi |
|
|
|
|
|
setup_host_resource "$service" |
|
|
loaded[$subservice]=1 |
|
|
loaded[$subservice]=1 |
|
|
done |
|
|
done |
|
|
done |
|
|
done |
|
|
return 0 |
|
|
return 0 |
|
|
} |
|
|
} |
|
|
|
|
|
export -f setup_host_resources |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
relation-get () { |
|
|
relation-get () { |
|
|