Skip to content

Commit 95890d2

Browse files
authored
fix a small bug in gmc e2e test (opea-project#131)
Signed-off-by: Yingchun Guo <yingchun.guo@intel.com>
1 parent af43e2f commit 95890d2

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/scripts/e2e/gmc_test.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,16 @@ function validate_gmc() {
4444

4545
function cleanup_gmc() {
4646
echo "clean up microservice-connector"
47-
kubectl delete ns $APP_NAMESPACE
48-
kubectl delete ns $CODEGEN_NAMESPACE
49-
kubectl delete ns $CODETRANS_NAMESPACE
50-
kubectl delete ns $SYSTEM_NAMESPACE
47+
namespaces=("$APP_NAMESPACE" "$CODEGEN_NAMESPACE" "$CODETRANS_NAMESPACE" "$SYSTEM_NAMESPACE")
48+
for ns in "${namespaces[@]}"; do
49+
kubectl get namespace "$ns" &> /dev/null
50+
if [ $? -eq 0 ]; then
51+
echo "Deleting namespace: $ns"
52+
kubectl delete namespace "$ns"
53+
else
54+
echo "Namespace $ns does not exist"
55+
fi
56+
done
5157
kubectl delete crd gmconnectors.gmc.opea.io
5258
}
5359

0 commit comments

Comments
 (0)