Skip to content

Commit

Permalink
feat(node-shell): optional pod running timeout (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Leroy <19607336+maxime1907@users.noreply.github.com>
  • Loading branch information
maxime1907 authored Dec 26, 2023
1 parent b4c24ea commit 8e91eb1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kubectl-node_shell
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

kubectl=kubectl
version=1.8.1
version=1.9.0
generator=""
node=""
nodefaultctx=0
Expand All @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 8e91eb1

Please sign in to comment.