-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
33 lines (30 loc) · 998 Bytes
/
Copy pathentrypoint.sh
File metadata and controls
33 lines (30 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
# Entrypoint script for agentgateway
# Supports mounted config override with priority:
# 1. /app/mounted-config/config.yaml (Azure Files mount)
# 2. /app/config.yaml (default baked into image)
MOUNTED_CONFIG="/app/mounted-config/config.yaml"
DEFAULT_CONFIG="/app/config.yaml"
# Check if --file is already in the arguments
HAS_FILE_ARG=0
for arg in "$@"; do
if [ "$arg" = "--file" ] || echo "$arg" | grep -q "^--file="; then
HAS_FILE_ARG=1
break
fi
done
if [ "$HAS_FILE_ARG" = "1" ]; then
# --file already provided in args, just pass through
echo "mounted config: $MOUNTED_CONFIG"
exec /app/agentgateway "$@"
else
# No --file arg, use default logic
if [ -f "$MOUNTED_CONFIG" ]; then
echo "Using mounted config: $MOUNTED_CONFIG"
CONFIG_FILE="$MOUNTED_CONFIG"
else
echo "Using default config: $DEFAULT_CONFIG"
CONFIG_FILE="$DEFAULT_CONFIG"
fi
exec /app/agentgateway --file "$CONFIG_FILE" "$@"
fi