From cdf2bbad6f3ed7b318e88298876285197387d879 Mon Sep 17 00:00:00 2001 From: Jack Foy Date: Fri, 7 May 2021 12:29:28 -0700 Subject: [PATCH] Improve plugin semantics Once the plugin has done its work, it should replace itself with `kubectl` (or the next plugin in the chain). --- bash/kubectl-sudo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash/kubectl-sudo b/bash/kubectl-sudo index bb0f941..4f3f2de 100755 --- a/bash/kubectl-sudo +++ b/bash/kubectl-sudo @@ -27,7 +27,7 @@ do done if [ -z "${PLUGIN_NAME}" ]; then - kubectl --as=${USER} --as-group=system:masters "$@" + exec kubectl --as=${USER} --as-group=system:masters "$@" else - kubectl ${PLUGIN_NAME} --as=${USER} --as-group=system:masters ${NEW_ARGS} + exec kubectl ${PLUGIN_NAME} --as=${USER} --as-group=system:masters ${NEW_ARGS} fi