Skip to content

Commit d6e7657

Browse files
authored
Merge pull request #838 from influxdata/pjb/allow-unsetting-env-vars
feat(entrypoint): allow unsetting env vars
2 parents 90a822e + 0cc6110 commit d6e7657

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

influxdb/3.6-enterprise/entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#!/bin/bash
22
set -euo pipefail
33

4+
# Unset environment variables; splitting on whitespace
5+
# Usage: INFLUXDB3_UNSET_VARS="HOST FOO BAR"
6+
if [[ -n "${INFLUXDB3_UNSET_VARS:-}" ]]; then
7+
read -ra vars <<< "${INFLUXDB3_UNSET_VARS}"
8+
for var in "${vars[@]}"; do
9+
unset "$var" || { echo "Error: Failed to unset variable '$var' (may be readonly)"; exit 1; }
10+
done
11+
fi
12+
413
args=("${@}")
514

615
if [[ "${args[0]:-}" == serve ]] ; then

0 commit comments

Comments
 (0)