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

fix: retain original process env when call spawn helper #6301

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

vvagaytsev
Copy link
Collaborator

@vvagaytsev vvagaytsev commented Jul 18, 2024

What this PR does / why we need it:

Prior to #6294 we have never used the env parameter of the function containerHelpers.dockerCli(...).

This PR ensures that the original process environment is always preserved and pass to the Docker process.
Without this fix, any custom env would replace the original process environment variables.
Instead of composing the merged env vars on the caller side, it's now done inside the helper function.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@vvagaytsev vvagaytsev requested a review from stefreak July 18, 2024 12:36
Copy link
Member

@stefreak stefreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, good work, this is a very important fix and a very good catch!
I had a couple of comments; I'm open to pair with you on them 👍

core/src/util/secrets.ts Outdated Show resolved Hide resolved
core/src/plugins/container/helpers.ts Outdated Show resolved Hide resolved
core/src/plugins/container/helpers.ts Outdated Show resolved Hide resolved
@vvagaytsev vvagaytsev changed the title fix(docker): retain original process env when call Docker CLI fix: retain original process env when call spawn helper Jul 18, 2024
@vvagaytsev vvagaytsev force-pushed the fix/docker-build-env branch from b5fe25a to 9a0d1e1 Compare July 18, 2024 13:09
@vvagaytsev vvagaytsev requested a review from stefreak July 18, 2024 13:14
Copy link
Member

@stefreak stefreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Looks real good now 👍

@vvagaytsev vvagaytsev enabled auto-merge July 18, 2024 13:20
@vvagaytsev vvagaytsev added this pull request to the merge queue Jul 18, 2024
Merged via the queue into main with commit 593b3e4 Jul 18, 2024
40 checks passed
@vvagaytsev vvagaytsev deleted the fix/docker-build-env branch July 18, 2024 13:59
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

Successfully merging this pull request may close these issues.

2 participants