fix: add TLS parameters for https ClickHouse endpoints in goose DB string (#1689)

Need to add `secure=true&skip_verify=false` TLS params for https (CHC)

Ref: https://github.com/pressly/goose/pull/796/changes
This commit is contained in:
Warren Lee 2026-02-03 00:13:56 +01:00 committed by GitHub
parent ea56d11f8b
commit 683ec1a80e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
"@hyperdx/otel-collector": patch
---
fix: add TLS parameters for https ClickHouse endpoints in goose DB string

View file

@ -16,9 +16,12 @@ if [ "$HYPERDX_OTEL_EXPORTER_CREATE_LEGACY_SCHEMA" != "true" ]; then
# Build goose connection string from environment variables
# CLICKHOUSE_ENDPOINT format: tcp://host:port, http://host:port, or https://host:port
# Note: database is not specified here since SQL files use ${DATABASE} prefix explicitly
# For https:// endpoints, add secure=true&skip_verify=false for TLS as required by the goose ClickHouse driver
case "$CLICKHOUSE_ENDPOINT" in
*\?*) GOOSE_DBSTRING="${CLICKHOUSE_ENDPOINT}&username=${DB_USER}&password=${DB_PASSWORD}" ;;
*) GOOSE_DBSTRING="${CLICKHOUSE_ENDPOINT}?username=${DB_USER}&password=${DB_PASSWORD}" ;;
https://*\?*) GOOSE_DBSTRING="${CLICKHOUSE_ENDPOINT}&username=${DB_USER}&password=${DB_PASSWORD}&secure=true&skip_verify=false" ;;
https://*) GOOSE_DBSTRING="${CLICKHOUSE_ENDPOINT}?username=${DB_USER}&password=${DB_PASSWORD}&secure=true&skip_verify=false" ;;
*\?*) GOOSE_DBSTRING="${CLICKHOUSE_ENDPOINT}&username=${DB_USER}&password=${DB_PASSWORD}" ;;
*) GOOSE_DBSTRING="${CLICKHOUSE_ENDPOINT}?username=${DB_USER}&password=${DB_PASSWORD}" ;;
esac
# Create temporary directory for processed SQL files