From 0c3f05fa50ee412bf40d3f7bf79ce4e8c13cb3b5 Mon Sep 17 00:00:00 2001
From: Madalyn Marabella <mmarabe@amazon.com>
Date: Mon, 8 May 2023 13:11:03 -0500
Subject: [PATCH] redirect port forward to /dev/null

---
 devops/aws/pipeline/override-stages.yml | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/devops/aws/pipeline/override-stages.yml b/devops/aws/pipeline/override-stages.yml
index 9bfebe30f..e640a0660 100644
--- a/devops/aws/pipeline/override-stages.yml
+++ b/devops/aws/pipeline/override-stages.yml
@@ -12,13 +12,8 @@ aws-update-tf:
     - aws eks update-kubeconfig --region $AWS_REGION --name $EKS_CLUSTER_NAME --role-arn $EKS_CLUSTER_MGMT_ROLE
 
     - localPort=$ELASTIC_PORT
-    - |
-      while netstat -an | grep $localPort | grep -i listen ; do
-        echo "$localPort Port in use"
-        ((localPort++))
-      done
     - echo $localPort
-    - kubectl port-forward -n $TENANT_GROUP_NAME-tenant-$EKS_TENANT_NAME-elasticsearch svc/elasticsearch-es-http $localPort:$ELASTIC_PORT
+    - kubectl port-forward -n $TENANT_GROUP_NAME-tenant-$EKS_TENANT_NAME-elasticsearch svc/elasticsearch-es-http $localPort:$ELASTIC_PORT > /dev/null 2>&1 &
     - export ELASTIC_PORT=$localPort
     - pid=$!
     - |
-- 
GitLab