kubectl should allow `//` preamble for plugins to avoid exec format error · Issue #822 · kubernetes/kubectl · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that where a git plugin can be as follows:
git-helloworld:
//usr/bin/env bash "$0" "$@" ; exit $?
echo "a plugin"
git helloworld
a plugin
(notice the use of // instead of #!) if you do the same for kubectl you get:
kubectl helloworld
exec format error
"
With this it is currently a must to have your script plugin start with "#!".
This is unfortunate since if you are using go or java single script notion they will not load.
They could out "#!" in header but all current IDE's will complain about the foreign "#!".
Better if kubectl would behave similar to git and support both "#!" and "//"
When invoking a kubectl plugin we use syscall.Exec (at least on linux) and we pass the entire execution to the child process, so this is more of binary level problem not kubectl
/close
When invoking a kubectl plugin we use syscall.Exec (at least on linux) and we pass the entire execution to the child process, so this is more of binary level problem not kubectl
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
I noticed that where a git plugin can be as follows:
git-helloworld:
(notice the use of
//
instead of#!
) if you do the same for kubectl you get:"
With this it is currently a must to have your script plugin start with "#!".
This is unfortunate since if you are using go or java single script notion they will not load.
They could out "#!" in header but all current IDE's will complain about the foreign "#!".
Better if kubectl would behave similar to git and support both "#!" and "//"
context: see https://github.com/maxandersen/k8s-cli-java for real world example of this.
The text was updated successfully, but these errors were encountered: