fix: ensure the new service does not exist when cloning an existing service

This commit is contained in:
Jose Diaz-Gonzalez
2022-07-06 01:47:31 -04:00
parent 78c2d69811
commit 20164dca78
2 changed files with 11 additions and 0 deletions

View File

@@ -411,6 +411,14 @@ service_enter() {
docker exec $DOKKU_RUN_OPTS $ID $EXEC_CMD "${@:-/bin/bash}"
}
service_exists() {
declare desc="returns 0 or 1 depending on whether service exists or not"
declare SERVICE="$1"
[[ -z "$SERVICE" ]] && return 1
[[ -d "$PLUGIN_DATA_ROOT/$SERVICE" ]] && return 0
return 1
}
service_exposed_ports() {
declare desc="list exposed ports for a service"
declare SERVICE="$1"