Skip to content
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

KUBERNETES_EXEC_INFO should be passed to exec plugin #568

Open
blowfishpro opened this issue Jul 21, 2022 · 2 comments
Open

KUBERNETES_EXEC_INFO should be passed to exec plugin #568

blowfishpro opened this issue Jul 21, 2022 · 2 comments

Comments

@blowfishpro
Copy link

Some exec plugins (e.g. aws eks get-token) use the info in this environment variable to determine what to return (including the api version which is checked by kubeclient. I believe it should take the form of a JSON string containing an ExecCredtial resource (see explanation here)

@cben
Copy link
Collaborator

cben commented Jun 25, 2023

One of the things it wants is spec.interactive, should be true if plugin has access to stdin where a user may respond.
I see we currently run plugin with Open3.capture3 which always pipes stdin, but suppose we change that to pass through stdin of the Ruby app using kubeclient. How then do we know if plugins can use stdin interactively? 🤔

  • Should kubeclient check whether stdin is a tty?
  • Do we need a new API? [possibly defaulting to whether stdin is a tty]

[I don't plan to work on this myself, PRs are always welcome]

@blowfishpro
Copy link
Author

blowfishpro commented Jun 29, 2023

I believe kubectl does check whether stdin is interactive to decide whether the exec plugin in question is compatible with the current environment.

I believe you can call Open3.capture3('command', stdin: :close) to force it to not be passed.

I guess the other option would be to look for /dev/tty(not sure what the windows equivalent might be) and pass that if available and requested ... that might cover some situations where stdin isn't available for interactivity (due to e.g. piping in a shell).

I have started poking at the code for this although I haven't had much time to dedicate to it. There are some other considerations around exec plugins that have made themselves apparent too though.

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

No branches or pull requests

2 participants