diff --git a/hack/start-debug-pod.sh b/hack/start-debug-pod.sh index 813d580..54f1347 100755 --- a/hack/start-debug-pod.sh +++ b/hack/start-debug-pod.sh @@ -60,6 +60,7 @@ EOF kubectl wait --for=condition=Ready pod/$DEBUG_POD_NAME -n $NAMESPACE # Open a shell inside the debug pod -kubectl exec -it $DEBUG_POD_NAME -n $NAMESPACE -- /bin/sh +kubectl exec -it $DEBUG_POD_NAME -n $NAMESPACE -- /bin/sh --stdin --tty -trap 'kubectl delete pod $DEBUG_POD_NAME -n $NAMESPACE' EXIT +# Delete the debug pod when the shell session ends +kubectl delete pod $DEBUG_POD_NAME -n $NAMESPACE