Skip to content

Commit 29b6200

Browse files
committed
fix: move format validation to libinfluxdb.sh
Signed-off-by: kizuna-lek <asd98041@qq.com>
1 parent 9c8e8f0 commit 29b6200

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

bitnami/influxdb/2/debian-12/rootfs/opt/bitnami/scripts/influxdb-env.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,6 @@ export INFLUXDB_CONF_FILE_FORMAT="${INFLUXDB_CONF_FILE_FORMAT:-"yaml"}"
8585
export INFLUXDB_CONF_FILE="${INFLUXDB_CONF_DIR}/config.${INFLUXDB_CONF_FILE_FORMAT}"
8686
export INFLUXDB_INITSCRIPTS_DIR="/docker-entrypoint-initdb.d"
8787

88-
case "${INFLUXDB_CONF_FILE_FORMAT}" in
89-
yaml|yml|toml|json)
90-
# Legal format
91-
;;
92-
*)
93-
error "Unsupported config file format: ${INFLUXDB_CONF_FILE_FORMAT}"
94-
exit 1
95-
;;
96-
esac
97-
9888
# InfluxDB 2.x aliases
9989
export INFLUXD_ENGINE_PATH="${INFLUXDB_VOLUME_DIR}"
10090
export INFLUXD_BOLT_PATH="${INFLUXDB_VOLUME_DIR}/influxd.bolt"

bitnami/influxdb/2/debian-12/rootfs/opt/bitnami/scripts/libinfluxdb.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ influxdb_validate() {
7474
done
7575
check_conflicting_ports "${ports_envs[@]}"
7676

77+
# Validate INFLUXDB_CONF_FILE_FORMAT if set
78+
if [[ -n "${INFLUXDB_CONF_FILE_FORMAT:-}" ]]; then
79+
case "${INFLUXDB_CONF_FILE_FORMAT,,}" in
80+
yaml|json|yml|toml) ;;
81+
*)
82+
print_validation_error "The allowed values for INFLUXDB_CONF_FILE_FORMAT are [yaml, json, yml, toml]"
83+
;;
84+
esac
85+
fi
86+
7787
[[ "$error_code" -eq 0 ]] || exit "$error_code"
7888
}
7989

0 commit comments

Comments
 (0)