Skip to content

Commit 2a39e0c

Browse files
committed
DLPX-96312 Resolved review comments
1 parent b886c95 commit 2a39e0c

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Standards-Version: 4.1.2
1313

1414
Package: performance-diagnostics
1515
Architecture: any
16-
Depends: python3-bpfcc, python3-minimal, python3-psutil, telegraf, docker.io, influxdb2
16+
Depends: python3-bpfcc, python3-minimal, python3-psutil, telegraf, docker.io, influxdb2, curl, openssl
1717
Description: eBPF-based Performance Diagnostic Tools
1818
A collection of eBPF-based tools for diagnosing performance issues.

influxdb/delphix-influxdb-init

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ INFLUXDB_INIT_CONF="$INFLUXDB_CONFIG_DIR/influxdb-init.conf"
2626
source "$INFLUXDB_INIT_CONF"
2727

2828
INFLUXDB_ADMIN_USER="admin"
29-
INFLUXDB_ADMIN_PASSWORD="$(openssl rand -hex 16)"
29+
INFLUXDB_ADMIN_PASSWORD=""
3030

3131
#
3232
# Log a message to stderr with a timestamp.
@@ -102,12 +102,15 @@ if [[ -f "$INFLUXDB_SETUP_STATE_FILE" ]]; then
102102
key="${line%%=*}"
103103
value="${line#*=}"
104104
case "$key" in
105-
ADMIN_TOKEN) ADMIN_TOKEN="$value" ;;
106-
ORG_ID) ORG_ID="$value" ;;
107-
BUCKET_ID) BUCKET_ID="$value" ;;
105+
ADMIN_TOKEN) ADMIN_TOKEN="$value" ;;
106+
ORG_ID) ORG_ID="$value" ;;
107+
BUCKET_ID) BUCKET_ID="$value" ;;
108+
INFLUXDB_ADMIN_PASSWORD) INFLUXDB_ADMIN_PASSWORD="$value" ;;
108109
esac
109110
done <"$INFLUXDB_SETUP_STATE_FILE"
110111
else
112+
# Generate password only when actually running setup for the first time.
113+
INFLUXDB_ADMIN_PASSWORD="$(openssl rand -hex 16)"
111114
SETUP_RESPONSE=$(influx_post "/api/v2/setup" "{
112115
\"username\": \"$INFLUXDB_ADMIN_USER\",
113116
\"password\": \"$INFLUXDB_ADMIN_PASSWORD\",
@@ -120,13 +123,14 @@ else
120123
ORG_ID=$(json_field "$SETUP_RESPONSE" "['org']['id']") || exit 1
121124
BUCKET_ID=$(json_field "$SETUP_RESPONSE" "['bucket']['id']") || exit 1
122125

123-
# Persist admin token + IDs immediately so a subsequent re-run can resume
124-
# without repeating the one-shot setup call.
126+
# Persist admin token + IDs + password immediately so a subsequent re-run
127+
# can resume without repeating the one-shot setup call, and so the password
128+
# stored in influxdb_meta always matches what InfluxDB was initialised with.
125129
old_umask="$(umask)"
126130
umask 077
127131
tmp_state="$(mktemp "${INFLUXDB_SETUP_STATE_FILE}.XXXXXX")"
128-
printf 'ADMIN_TOKEN=%s\nORG_ID=%s\nBUCKET_ID=%s\n' \
129-
"$ADMIN_TOKEN" "$ORG_ID" "$BUCKET_ID" >"$tmp_state"
132+
printf 'ADMIN_TOKEN=%s\nORG_ID=%s\nBUCKET_ID=%s\nINFLUXDB_ADMIN_PASSWORD=%s\n' \
133+
"$ADMIN_TOKEN" "$ORG_ID" "$BUCKET_ID" "$INFLUXDB_ADMIN_PASSWORD" >"$tmp_state"
130134
chmod 600 "$tmp_state"
131135
mv "$tmp_state" "$INFLUXDB_SETUP_STATE_FILE"
132136
umask "$old_umask"

0 commit comments

Comments
 (0)