forked from reactive-tech/kubegres
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Failover volume mount should also use custom map if configured
- Loading branch information
1 parent
05da6ca
commit af2af33
Showing
7 changed files
with
130 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
test/resourceConfigs/customConfig/configMap_with_promote_replica_script.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: config-with-promote-replica-script | ||
namespace: default | ||
labels: | ||
environment: acceptancetesting | ||
|
||
data: | ||
|
||
promote_replica_to_primary.sh: | | ||
#!/bin/bash | ||
set -e | ||
dt=$(date '+%d/%m/%Y %H:%M:%S'); | ||
echo "$dt - Attempting to promote a Replica PostgreSql to Primary..."; | ||
standbyFilePath="$PGDATA/standby.signal" | ||
if [ ! -f "$standbyFilePath" ]; then | ||
echo "$dt - Skipping as this PostgreSql is already a Primary since the file '$standbyFilePath' does not exist." | ||
exit 0 | ||
fi | ||
promotionTriggerFilePath="$PGDATA/promote_replica_to_primary.log" | ||
if [ -f "$promotionTriggerFilePath" ]; then | ||
echo "$dt - Skipping as the promotion trigger file '$promotionTriggerFilePath' already exists" | ||
exit 0 | ||
fi | ||
echo "$dt - Promoting by creating the promotion trigger file: '$promotionTriggerFilePath'" | ||
touch $promotionTriggerFilePath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters