question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow inheriting some environment variables

See original GitHub issue

In many places you call subprocess.run() passing it some hand-crafted environment (passing env=<some dict> to the function). This prevents the sub-process from inherit some important variables. For example we have terraform modules that interact with kubernetes, yet they cannot see the KUBECONFIG environment variable from the parent shell. This can result in various outcomes from authentication failures to talking to the wrong cluster leading to messing up terraform state.

Would you consider adding a way to provide a list of variable sub-processes can inherit ? Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cansjtcommented, Sep 10, 2020

Apparently it is version 7.9.0 of tfwrapper we are using. So the fix above should solve my issue ! Will see that we update tfwrapper. Thank a lot for the prompt answer ! Hopefully that will close the issue. Will keep you informed.

0reactions
cansjtcommented, Apr 1, 2021

Yes, sorry ! Don’t have time to investigate this further, so let’s close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception of inheritance of environment variables
I understand that "when a process is created it inherits a duplicate environment of its parent process".
Read more >
Allow inheriting environment variable in downstream pipeline
Combine the ability to inherit environment variables with the ability to pass variables to a downstream pipeline. Currently bridge jobs do not ...
Read more >
How does a program inherit environment variables?
First, the shell forks. Forked process obviously has the same environment. Then a new program is executed in the child. The syscall in...
Read more >
5.4. Environment Variables
By default, environment variables are inherited from a process' parent. ... Some environment variables are dangerous because many libraries and programs are ...
Read more >
Why don't elevated processes inherit their environment ...
As a general rule, child processes inherit the environment of their parent. But if the parent is non-elevated and the child is elevated,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found