Skip to content

Commit

Permalink
🐛 Use namespace when using get pods (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgepstaylor authored Sep 11, 2024
1 parent 1959ec5 commit db18fd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/scripts/opensearch-connect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ trap ctrl_c INT
# trap fail and call fail()
trap fail ERR

main() {
main() {
env=$1

if [ "$env" == "poc" ]; then
namespace="hmpps-delius-alfrsco-${env}"
else
else
namespace="hmpps-delius-alfresco-${env}"
fi
echo "Connecting to Opensearch in namespace $namespace"
Expand All @@ -22,7 +22,7 @@ main() {
fi

# get opensearch proxy pod name
OPENSEARCH_PROXY_POD=$(kubectl get pods | grep 'opensearch-proxy-cloud-platform' | awk '{print $1}')
OPENSEARCH_PROXY_POD=$(kubectl get pods --namespace ${namespace} | grep 'opensearch-proxy-cloud-platform' | awk '{print $1}')
printf "\n****************************************************\n"
printf "Connect to http://localhost:$PORT locally\n"
printf "Press Ctrl+C to stop port forwarding \n"
Expand Down

0 comments on commit db18fd7

Please sign in to comment.