mirror of
https://github.com/dolthub/dolt.git
synced 2025-12-16 19:36:23 -06:00
amend to only fix
This commit is contained in:
@@ -394,11 +394,7 @@ _main() {
|
||||
|
||||
# if there is a single yaml provided in /etc/dolt/servercfg.d directory,
|
||||
# it will be used to start the server with --config flag.
|
||||
get_config_file_path_if_exists "$DOLT_CONFIG_DIR" "yaml"
|
||||
if [ -z "$CONFIG_PROVIDED" ]; then
|
||||
get_config_file_path_if_exists "$SERVER_CONFIG_DIR" "yaml"
|
||||
fi
|
||||
|
||||
get_config_file_path_if_exists "$SERVER_CONFIG_DIR" "yaml"
|
||||
if [ -n "$CONFIG_PROVIDED" ]; then
|
||||
set -- "$@" --config="$CONFIG_PROVIDED"
|
||||
fi
|
||||
|
||||
@@ -274,39 +274,20 @@ EOF
|
||||
}
|
||||
|
||||
# bats test_tags=no_lambda
|
||||
@test "docker-entrypoint: doltcfg.d applies log level yaml" {
|
||||
# https://github.com/dolthub/dolt/issues/10053
|
||||
cname="${TEST_PREFIX}server-config-log"
|
||||
temp_dir="$BATS_TMPDIR/server-config-log-$$"
|
||||
mkdir -p "$temp_dir"
|
||||
cat > "$temp_dir/config.yaml" <<'EOF'
|
||||
log_level: debug
|
||||
EOF
|
||||
|
||||
run_container "$cname" -v "$temp_dir":/etc/dolt/doltcfg.d:ro
|
||||
|
||||
docker logs "$cname" >"$BATS_TMPDIR/${cname}.log" 2>&1
|
||||
cat $BATS_TMPDIR/${cname}.log
|
||||
run grep -F "Starting server with Config" "$BATS_TMPDIR/${cname}.log"
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ 'L="debug"' ]] || false
|
||||
|
||||
rm -rf "$temp_dir"
|
||||
}
|
||||
|
||||
# bats test_tags=no_lambda
|
||||
@test "docker-entrypoint: doltcfg.d json and yaml both honored" {
|
||||
@test "docker-entrypoint: doltcfg.json and servercfg.yaml both honored" {
|
||||
cname="${TEST_PREFIX}server-config-json-yaml"
|
||||
temp_dir="$BATS_TMPDIR/server-config-json-yaml-$$"
|
||||
mkdir -p "$temp_dir"
|
||||
cat > "$temp_dir/config.json" <<'EOF'
|
||||
mkdir -p "$temp_dir/doltcfg" "$temp_dir/servercfg"
|
||||
cat > "$temp_dir/doltcfg/config.json" <<'EOF'
|
||||
{}
|
||||
EOF
|
||||
cat > "$temp_dir/config.yaml" <<'EOF'
|
||||
cat > "$temp_dir/servercfg/config.yaml" <<'EOF'
|
||||
log_level: debug
|
||||
EOF
|
||||
|
||||
run_container "$cname" -v "$temp_dir":/etc/dolt/doltcfg.d:ro
|
||||
run_container "$cname" \
|
||||
-v "$temp_dir/doltcfg":/etc/dolt/doltcfg.d:ro \
|
||||
-v "$temp_dir/servercfg":/etc/dolt/servercfg.d:ro
|
||||
|
||||
docker logs "$cname" >"$BATS_TMPDIR/${cname}.log" 2>&1
|
||||
run grep -F "Starting server with Config" "$BATS_TMPDIR/${cname}.log"
|
||||
|
||||
Reference in New Issue
Block a user