Merge pull request #4311 from nisseknudsen/pr/allow_named_volume_mounts_in_regex

Allow named volume mounts in regex
This commit is contained in:
Jose Diaz-Gonzalez
2021-01-15 17:53:59 -05:00
committed by GitHub
2 changed files with 11 additions and 1 deletions

View File

@@ -6,7 +6,13 @@ source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
verify_paths() {
declare desc="verifies storage paths"
echo "$1" | grep -qe '^/.*\:/' || dokku_log_fail "Storage path must be two valid paths divided by colon."
local -r passed_path=$1
if [[ "$passed_path" = /* ]]; then
echo "$passed_path" | grep -qe '^/.*\:/' || dokku_log_fail "Storage path must be two valid paths divided by colon."
else
echo "$passed_path" | grep -qe '^[a-zA-Z0-9]\{1\}[a-zA-Z0-9_.-]\+\:\/' || dokku_log_fail "Volume name must be two characters or more. Volume name must not contain invalid characters. Storage path must be two valid paths divided by colon."
fi
}
check_if_path_exists() {

View File

@@ -53,4 +53,8 @@ teardown() {
echo "status: $status"
assert_output " ! Mount path does not exist."
assert_failure
run /bin/bash -c "dokku storage:mount $TEST_APP mount_volume:/mount"
echo "output: $output"
echo "status: $status"
assert_success
}