Skip to content

Commit

Permalink
fix psql consuming stdin used for looping through pods
Browse files Browse the repository at this point in the history
  • Loading branch information
frnckdlprt committed Oct 6, 2023
1 parent 8b8a49a commit a31911b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generate_postmortem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ for NAMESPACE in $NAMESPACE_LIST; do
for QUERY in "${POSTGRES_QUERIES[@]}"; do
QUERY_RUNNING="${!QUERY}"
echo "$QUERY_RUNNING" >> $health_dir/postgres-sql-queries.out
SQL_OUTPUT=`$KUBECTL exec -i ${pod} -- psql -c "$QUERY_RUNNING" 2>"/dev/null"`
SQL_OUTPUT=`$KUBECTL exec -i ${pod} -- psql -c "$QUERY_RUNNING" 2>/dev/null </dev/null`
echo -e "$SQL_OUTPUT\n" >> $health_dir/postgres-sql-queries.out
done

Expand All @@ -1337,7 +1337,7 @@ for NAMESPACE in $NAMESPACE_LIST; do
for QUERY in "${APIM_QUERIES[@]}"; do
QUERY_RUNNING="${!QUERY}"
echo "$QUERY_RUNNING" >> $health_dir/apim-sql-queries.out
SQL_OUTPUT=`$KUBECTL exec -i ${pod} -- psql -d apim -c "$QUERY_RUNNING" 2>"/dev/null"`
SQL_OUTPUT=`$KUBECTL exec -i ${pod} -- psql -d apim -c "$QUERY_RUNNING" 2>/dev/null </dev/null`
echo -e "$SQL_OUTPUT\n" >> $health_dir/apim-sql-queries.out
done

Expand All @@ -1346,7 +1346,7 @@ for NAMESPACE in $NAMESPACE_LIST; do
for QUERY in "${LUR_QUERIES[@]}"; do
QUERY_RUNNING="${!QUERY}"
echo "$QUERY_RUNNING" >> $health_dir/lur-sql-queries.out
SQL_OUTPUT=`$KUBECTL exec -i ${pod} -- psql -d lur -c "$QUERY_RUNNING" 2>"/dev/null"`
SQL_OUTPUT=`$KUBECTL exec -i ${pod} -- psql -d lur -c "$QUERY_RUNNING" 2>/dev/null </dev/null`
echo -e "$SQL_OUTPUT\n" >> $health_dir/lur-sql-queries.out
done

Expand Down

0 comments on commit a31911b

Please sign in to comment.