From 6775daa8d4e8bb5eadff6a3d02d1ff7bee6223ab Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Jan 2018 22:55:42 -0500 Subject: [PATCH] fix: allow unlinking a service regardless of config status Closes dokku/dokku-redis#92 --- common-functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common-functions b/common-functions index aa4f026..413c050 100755 --- a/common-functions +++ b/common-functions @@ -575,7 +575,6 @@ service_unlink() { local SERVICE_ALIAS=$(service_alias "$SERVICE") local LINK=($(echo "$EXISTING_CONFIG" | grep "$SERVICE_URL" | cut -d: -f1)) || true - [[ -z ${LINK[*]} ]] && dokku_log_fail "Not linked to app $APP" remove_from_links_file "$SERVICE" "$APP" if declare -f -F add_passed_docker_option > /dev/null; then @@ -585,6 +584,8 @@ service_unlink() { else dokku docker-options:remove "$APP" build,deploy,run "--link $SERVICE_NAME:$SERVICE_ALIAS" fi + + [[ -z ${LINK[*]} ]] && dokku_log_fail "Not linked to app $APP" config_unset "$APP" "${LINK[*]}" }