Skip to content

Commit

Permalink
fix: add alternate construction for jq 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
fboulnois committed Jul 12, 2024
1 parent 2fa297c commit 4d9048e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ops/db-connect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ port_forward_sqlproxy() {
fi

# select the first pod that has a name that contains "sqlproxy"
SQLPROXY_POD=$(kubectl get pods --namespace="$NAMESPACE" --output="json" | jq -r '[ .items[].metadata.name | select(. | contains("sqlproxy")) ].[0]')
SQLPROXY_POD=$(kubectl get pods --namespace="$NAMESPACE" --output="json" | jq -r '.items | map(.metadata.name | select(contains("sqlproxy"))) | first')
kubectl port-forward "$SQLPROXY_POD" --namespace "$NAMESPACE" "$PORT:5432" &
PID=$!
trap cleanup EXIT
Expand Down

0 comments on commit 4d9048e

Please sign in to comment.