From d25b680440803029100141e959a5b8becefd63f0 Mon Sep 17 00:00:00 2001 From: Maxime Leroy <19607336+maxime1907@users.noreply.github.com> Date: Fri, 15 Sep 2023 16:30:51 +0200 Subject: [PATCH] feat(node-shell): optional pod running timeout 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 be488f0..9dd46a7 100755 --- a/kubectl-node_shell +++ b/kubectl-node_shell @@ -2,7 +2,7 @@ set -e kubectl=kubectl -version=1.8.0 +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 @@ -179,4 +180,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