-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add option in pebble exec to inherit environment variables from caller's environment #172
Comments
Unlike sudo, the thing being started is not a plain shell or a plain command, but rather a program that will carry its own environment and configuration, and in general will have an expectation of it being preserved. Blindly fiddling with this environment is likely to result in unexpected behavior. For that kind of reason, even in applications such as ssh the client environment's won't be sent over transparently. Can you provide some further details about what you intent to do with it? Maybe there is some alternative. |
See also the planned feature for exec (and exec-type health checks) we've called "context", which would allow you to run commands in the context of another service, or of Pebble itself:
Would |
The use case is Apache Spark (short-lived) batch jobs where the rock image gets spawned as driver pod as well as executor pods (driver / executor is just an execution mode argument for the rock). They do their bit and the pods are torn down.
This issue pertains to 3. where some facility to inherit all environment variables from caller's environment (root) can be made available for the pebble exec command's target environment (non-root). I believe PID != 1 issue in 2. will be addressed with the "pebble enter exec" command which is being developed, so did not raise that separately. |
@averma-canonical Thanks for that description. It seems to me that the addition of |
Thanks @benhoyt. Yes that is exactly what we need. |
Thanks. In that case I'll close this issue in favour of the existing #159. |
Request to add an option in pebble exec command to inherit environment variables from the caller's environment, much like the preserve-env option in sudo.
The use case is for pebble to execute a one-shot command as a non-root user inheriting all environment variables the rock has defined for the root user.
The text was updated successfully, but these errors were encountered: