8000 kubectl should allow `//` preamble for plugins to avoid exec format error · Issue #822 · kubernetes/kubectl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kubectl should allow // preamble for plugins to avoid exec format error #822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maxandersen opened this issue Feb 15, 2020 · 4 comments
Closed

Comments

@maxandersen
Copy link

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 "//"

context: see https://github.com/maxandersen/k8s-cli-java for real world example of this.

@soltysh
Copy link
Contributor
soltysh commented Feb 19, 2020

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

@k8s-ci-robot
Copy link
Contributor

@soltysh: Closing this issue.

In response to this:

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.

@maxandersen
Copy link
Author

that’s a shame. as noted other cli's, i.e. git, that uses same mechanism of - in path this works. kubectl stands out.

I tried looking in the source code but couldn't find the actual place this call is made - can you give a pointer ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0