From c32a71ad7447eeab177977aec2133c258e7ab03d Mon Sep 17 00:00:00 2001 From: Edwin Hermans Date: Thu, 30 Dec 2021 14:48:02 -0500 Subject: [PATCH 1/3] allow for node/$nodename resource form I sometimes use this plugin with a `for node in $(kubectl get names -o node); do kubectl node-shell "$node" -- something` loop. The kubectl get names -o node outputs a list of nodenames prefixed with the `node/` type. This change will, always, simply filter out `node/` at the beginning of the node name. --- kubectl-node_shell | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubectl-node_shell b/kubectl-node_shell index 180b3dd..6b51c85 100755 --- a/kubectl-node_shell +++ b/kubectl-node_shell @@ -58,7 +58,7 @@ while [ $# -gt 0 ]; do ;; *) if [ -z "$node" ]; then - node="$1" + node="$(echo $1 | sed 's/^node\///')" shift else echo "exactly one node required" From 6d803fec60a0cb5f1c4f566d41582df1104a7d2a Mon Sep 17 00:00:00 2001 From: Edwin Hermans Date: Mon, 3 Jan 2022 13:37:26 -0500 Subject: [PATCH 2/3] Update kubectl-node_shell Co-authored-by: Andrei Kvapil --- kubectl-node_shell | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubectl-node_shell b/kubectl-node_shell index 6b51c85..c13dcaf 100755 --- a/kubectl-node_shell +++ b/kubectl-node_shell @@ -58,7 +58,7 @@ while [ $# -gt 0 ]; do ;; *) if [ -z "$node" ]; then - node="$(echo $1 | sed 's/^node\///')" + node="${1#node/}" shift else echo "exactly one node required" From 7c869507de277fbb742129f222079e59861f98d7 Mon Sep 17 00:00:00 2001 From: Edwin Hermans Date: Mon, 3 Jan 2022 13:38:52 -0500 Subject: [PATCH 3/3] Bump up version string --- kubectl-node_shell | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubectl-node_shell b/kubectl-node_shell index c13dcaf..0c065b9 100755 --- a/kubectl-node_shell +++ b/kubectl-node_shell @@ -2,7 +2,7 @@ set -e kubectl=kubectl -version=1.5.3 +version=1.5.4 generator="" node="" nodefaultctx=0