-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathentrypoint.sh
More file actions
22 lines (19 loc) · 840 Bytes
/
entrypoint.sh
File metadata and controls
22 lines (19 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -e
# Configuration file path
CONFIG_FILE="${CONFIG_FILE:-/etc/probod/config.yml}"
# If bootstrap env vars are set, always (re)generate the config from them.
# This ensures that updated env vars take effect even when a stale config
# file exists on a persistent volume. When no env vars are present, fall
# back to an existing config file (e.g., mounted from a ConfigMap).
if [ -n "$PROBOD_ENCRYPTION_KEY" ]; then
echo "Generating configuration file from environment variables at: $CONFIG_FILE"
probod-bootstrap -output "$CONFIG_FILE"
elif [ -f "$CONFIG_FILE" ]; then
echo "Using existing configuration file at: $CONFIG_FILE"
else
echo "Error: no bootstrap env vars set and no config file found at $CONFIG_FILE" >&2
exit 1
fi
# Execute probod with the generated config
exec probod -cfg-file "$CONFIG_FILE" "$@"