Browse Source

fix: [compose-core] display errors when running action and constraints are not verified

Before it would quit without any notice. A message is also added for a
common fix when constraints fails unexpectedly.
cache-relation
Valentin Lab 1 year ago
parent
commit
7d860f732a
  1. 8
      bin/compose-core

8
bin/compose-core

@ -2611,7 +2611,8 @@ get_all_relations () {
providers_def=()
array_read-0 providers providers_def < <(_get_charm_providing "$relation_name" "${service_list[@]}")
if [ "${#providers[@]}" == 0 ]; then
die "Summoning a ${DARKBLUE}$relation_name${NORMAL} provider failed: none were found in charm store."
err "Summoning a ${DARKBLUE}$relation_name${NORMAL} provider failed: none were found in charm store."
return 1
fi
if [ "${#providers[@]}" -gt 1 ]; then
@ -4322,7 +4323,10 @@ if [ -z "$is_docker_compose_action" -a "$action" ]; then
esac
} < <(has_service_action "$action_service" "$action")
services_args=("$action_service")
get_all_relations "${services_args[@]}" >/dev/null 2>&1 || exit 1
get_all_relations "${services_args[@]}" >/dev/null || {
echo " Hint: if this is unexpected, you can try to delete caches, and re-run the command." >&2
exit 1
}
## Divert logging to stdout to stderr
log () { cat >&2; }

Loading…
Cancel
Save