From 8e91eb1193ec72ded206df7c797a05caef909ca4 Mon Sep 17 00:00:00 2001 From: Maxime Leroy <19607336+maxime1907@users.noreply.github.com> Date: Tue, 26 Dec 2023 10:34:41 +0100 Subject: [PATCH] feat(node-shell): optional pod running timeout (#57) Signed-off-by: Maxime Leroy <19607336+maxime1907@users.noreply.github.com> --- kubectl-node_shell | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kubectl-node_shell b/kubectl-node_shell index 519e41a..7e99184 100755 --- a/kubectl-node_shell +++ b/kubectl-node_shell @@ -2,7 +2,7 @@ set -e kubectl=kubectl -version=1.8.1 +version=1.9.0 generator="" node="" nodefaultctx=0 @@ -13,6 +13,7 @@ volumes="[]" volume_mounts="[]" x_mode=0 labels="${KUBECTL_NODE_SHELL_LABELS}" +pod_running_timeout="${KUBECTL_NODE_SHELL_POD_RUNNING_TIMEOUT:-1m}" if [ -t 0 ]; then tty=true @@ -181,4 +182,4 @@ fi trap "EC=\$?; $kubectl delete pod --wait=false $pod >&2 || true; exit \$EC" EXIT INT TERM echo "spawning \"$pod\" on \"$node\"" >&2 -$kubectl run --image "$image" --restart=Never --overrides="$overrides" --labels="$labels" $([ "$tty" = true ] && echo -t) -i "$pod" $generator +$kubectl run --image "$image" --restart=Never --overrides="$overrides" --labels="$labels" --pod-running-timeout="$pod_running_timeout" $([ "$tty" = true ] && echo -t) -i "$pod" $generator