From 0b0394a940bacb198e20fcfafc0ef43002324e94 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sat, 17 Feb 2024 14:29:53 +0000 Subject: [PATCH] Use absolute path for the data volume (#749) Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/749 Co-authored-by: David Boreham Co-committed-by: David Boreham --- tests/database/run-test.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/database/run-test.sh b/tests/database/run-test.sh index e6aca59c..405f6d34 100755 --- a/tests/database/run-test.sh +++ b/tests/database/run-test.sh @@ -73,8 +73,8 @@ mkdir -p $CERC_REPO_BASE_DIR $TEST_TARGET_SO --stack ${stack} setup-repositories $TEST_TARGET_SO --stack ${stack} build-containers # Test basic stack-orchestrator deploy to k8s -test_deployment_dir=$CERC_REPO_BASE_DIR/test-${deployment_dir} -test_deployment_spec=$CERC_REPO_BASE_DIR/test-${spec_file} +test_deployment_dir=$CERC_REPO_BASE_DIR/${deployment_dir} +test_deployment_spec=$CERC_REPO_BASE_DIR/${spec_file} $TEST_TARGET_SO --stack ${stack} deploy --deploy-to k8s-kind init --output $test_deployment_spec # Check the file now exists @@ -85,6 +85,9 @@ if [ ! -f "$test_deployment_spec" ]; then fi echo "deploy init test: passed" +# Switch to a full path for the data dir so it gets provisioned as a host bind mounted volume and preserved beyond cluster lifetime +sed -i "s|^\(\s*db-data:$\)$|\1 ${test_deployment_dir}/data/db-data|" $test_deployment_spec + $TEST_TARGET_SO --stack ${stack} deploy create --spec-file $test_deployment_spec --deployment-dir $test_deployment_dir # Check the deployment dir exists if [ ! -d "$test_deployment_dir" ]; then