Skip to content

[26.1 backport] cli-plugins: PluginRunCommand: use cmd.Environ instead of os.Environ#5047

Merged
vvoland merged 1 commit intodocker:26.1from
vvoland:v26.1-5038
Apr 30, 2024
Merged

[26.1 backport] cli-plugins: PluginRunCommand: use cmd.Environ instead of os.Environ#5047
vvoland merged 1 commit intodocker:26.1from
vvoland:v26.1-5038

Conversation

@vvoland
Copy link
Collaborator

@vvoland vvoland commented Apr 30, 2024

Commit 5011759 implemented a fix that caused the current environment to be discarded, using os.Environ(). On Windows, os.Environ() may produce an incorrect value for PWD, for which a new function was added in go1.19;

Replace the use of os.Environ() with cmd.Environ() to address that.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Commit 5011759 implemented a fix that
caused the current environment to be discarded, using `os.Environ()`.
On Windows, `os.Environ()` may produce an incorrect value for `PWD`,
for which a new function was added in go1.19;

- https://tip.golang.org/doc/go1.19#osexecpkgosexec
- https://go-review.googlesource.com/c/go/+/401340

Replace the use of `os.Environ()` with `cmd.Environ()` to address that.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 5ccb484)
Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland added this to the 26.1.1 milestone Apr 30, 2024
@vvoland vvoland self-assigned this Apr 30, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 61.08%. Comparing base (1e6db5d) to head (1c6a8ec).

Additional details and impacted files
@@           Coverage Diff           @@
##             26.1    #5047   +/-   ##
=======================================
  Coverage   61.08%   61.08%           
=======================================
  Files         295      295           
  Lines       20664    20663    -1     
=======================================
  Hits        12623    12623           
+ Misses       7143     7142    -1     
  Partials      898      898           

@vvoland vvoland requested a review from thaJeztah April 30, 2024 11:09
@vvoland vvoland requested a review from laurazard April 30, 2024 11:13
@vvoland vvoland merged commit 4cf5afa into docker:26.1 Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants