mirror of
https://github.com/rubenhensen/k8scd.git
synced 2026-09-17 02:12:55 +02:00
Add init container sogo 2
This commit is contained in:
@@ -32,10 +32,10 @@ spec:
|
|||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
# Copy config files from ConfigMap and substitute environment variables
|
# Copy config files from ConfigMap and substitute environment variables
|
||||||
|
# Use awk to avoid sed regex issues with special characters
|
||||||
for file in /config-template/*; do
|
for file in /config-template/*; do
|
||||||
filename=$(basename "$file")
|
filename=$(basename "$file")
|
||||||
# Use sed to replace ${POSTGRES_PASSWORD} with actual value
|
awk -v pwd="$POSTGRES_PASSWORD" '{gsub(/\$\{POSTGRES_PASSWORD\}/, pwd); print}' "$file" > "/config/$filename"
|
||||||
sed "s|\${POSTGRES_PASSWORD}|${POSTGRES_PASSWORD}|g" "$file" > "/config/$filename"
|
|
||||||
done
|
done
|
||||||
echo "Configuration files generated successfully"
|
echo "Configuration files generated successfully"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|||||||
Reference in New Issue
Block a user