fix: allow unlinking a service regardless of config status

Closes dokku/dokku-redis#92
This commit is contained in:
Jose Diaz-Gonzalez
2018-01-11 22:56:11 -05:00
parent 15a4a0d4c1
commit 2e79f89912

View File

@@ -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[*]}"
}