mirror of
https://github.com/bitnami/containers.git
synced 2026-03-23 14:57:41 +08:00
[bitnami/clickhouse] add support for etc/config.d (#76236)
etc/conf.d is obselete, etc/config.d should be used. etc/conf.d is still supported for backward compatibility. Signed-off-by: Paweł Szynkiewicz <pawel.szynkiewicz@nask.pl> Co-authored-by: Paweł Szynkiewicz <pawel.szynkiewicz@nask.pl>
This commit is contained in:
@@ -20,7 +20,7 @@ set -o pipefail
|
||||
ensure_user_exists "$CLICKHOUSE_DAEMON_USER" --group "$CLICKHOUSE_DAEMON_GROUP" --system
|
||||
|
||||
# Create directories
|
||||
for dir in "$CLICKHOUSE_DATA_DIR" "$CLICKHOUSE_CONF_DIR" "${CLICKHOUSE_CONF_DIR}/conf.d" "${CLICKHOUSE_CONF_DIR}/users.d" "$CLICKHOUSE_DEFAULT_CONF_DIR" "$CLICKHOUSE_LOG_DIR" "$CLICKHOUSE_TMP_DIR" "$CLICKHOUSE_MOUNTED_CONF_DIR" "/docker-entrypoint-startdb.d" "/docker-entrypoint-initdb.d"; do
|
||||
for dir in "$CLICKHOUSE_DATA_DIR" "$CLICKHOUSE_CONF_DIR" "${CLICKHOUSE_CONF_DIR}/conf.d" "${CLICKHOUSE_CONF_DIR}/config.d" "${CLICKHOUSE_CONF_DIR}/users.d" "$CLICKHOUSE_DEFAULT_CONF_DIR" "$CLICKHOUSE_LOG_DIR" "$CLICKHOUSE_TMP_DIR" "$CLICKHOUSE_MOUNTED_CONF_DIR" "/docker-entrypoint-startdb.d" "/docker-entrypoint-initdb.d"; do
|
||||
ensure_dir_exists "$dir"
|
||||
configure_permissions_ownership "$dir" -d "775" -f "664" -u "$CLICKHOUSE_DAEMON_USER" -g "root"
|
||||
done
|
||||
@@ -88,4 +88,4 @@ clickhouse_conf_set "/clickhouse/logger/console" "1"
|
||||
|
||||
# Copy all initially generated configuration files to the default directory
|
||||
# (this is to avoid breaking when entrypoint is being overridden)
|
||||
cp -r "${CLICKHOUSE_CONF_DIR}/"* "$CLICKHOUSE_DEFAULT_CONF_DIR"
|
||||
cp -r "${CLICKHOUSE_CONF_DIR}/"* "$CLICKHOUSE_DEFAULT_CONF_DIR"
|
||||
|
||||
@@ -82,15 +82,15 @@ clickhouse_copy_mounted_configuration() {
|
||||
# base etc folder
|
||||
find "$CLICKHOUSE_MOUNTED_CONF_DIR" -maxdepth 1 \( -type f -o -type l \) -exec cp -L -r {} "$CLICKHOUSE_CONF_DIR" \;
|
||||
|
||||
# The ClickHouse override directories (etc/conf.d and etc/users.d) do not support subfolders. That means we cannot
|
||||
# The ClickHouse override directories (etc/conf.d, etc/config.d and etc/users.d) do not support subfolders. That means we cannot
|
||||
# copy directly with cp -RL because we need all override xml files to have at the root of these subfolders. In the helm
|
||||
# chart we want to allow overrides from different ConfigMaps and Secrets so we need to use the find command
|
||||
if [[ -d "${CLICKHOUSE_MOUNTED_CONF_DIR}/conf.d" ]]; then
|
||||
find "${CLICKHOUSE_MOUNTED_CONF_DIR}/conf.d" \( -type f -o -type l \) -exec cp -L -r {} "${CLICKHOUSE_CONF_DIR}/conf.d" \;
|
||||
fi
|
||||
if [[ -d "${CLICKHOUSE_MOUNTED_CONF_DIR}/users.d" ]]; then
|
||||
find "${CLICKHOUSE_MOUNTED_CONF_DIR}/users.d" \( -type f -o -type l \) -exec cp -L -r {} "${CLICKHOUSE_CONF_DIR}/users.d" \;
|
||||
fi
|
||||
# chart we want to allow overrides from different ConfigMaps and Secrets so we need to use the find command.
|
||||
# etc/conf.d is now obselete but still supported.
|
||||
for dir in conf.d config.d users.d; do
|
||||
if [[ -d "${CLICKHOUSE_MOUNTED_CONF_DIR}/${dir}" ]]; then
|
||||
find "${CLICKHOUSE_MOUNTED_CONF_DIR}/${dir}" \( -type f -o -type l \) -exec cp -L -r {} "${CLICKHOUSE_CONF_DIR}/${dir}" \;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
else
|
||||
warn "The folder $CLICKHOUSE_CONF_DIR is not writable. This is likely because a read-only filesystem was mounted in that folder. Using $CLICKHOUSE_MOUNTED_DIR is recommended"
|
||||
|
||||
Reference in New Issue
Block a user