Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Default to primary pod via label
Browse files Browse the repository at this point in the history
  • Loading branch information
Heavybullets8 committed Nov 22, 2023
1 parent e7af3a7 commit a287649
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/backup_restore/database/cnpg_dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dump_database() {
output_dir="$2/${app}"
output_file="${output_dir}/${app}_${timestamp}.sql.gz"

cnpg_pod=$(k3s kubectl get pods -n "ix-$app" --no-headers -o custom-columns=":metadata.name" | grep -E -- "-cnpg-main-1$")
cnpg_pod=$(k3s kubectl get pods -n "ix-$app" --no-headers -o custom-columns=":metadata.name" -l role=primary | head -n 1)

if [[ -z $cnpg_pod ]]; then
echo_backup+=("Failed to get cnpg pod for $app.")
Expand Down

0 comments on commit a287649

Please sign in to comment.