-
Notifications
You must be signed in to change notification settings - Fork 207
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: append existing env variables to provision cmd #5187
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: Artun Duman <[email protected]>
lilypan26
requested review from
juan-lee,
cameronmeissner,
UtheMan,
ganeshkumarashok,
anujmaheshwari1,
AlisonB319,
Devinwong,
ShiqianTao,
AbelHu,
junjiezhang1997,
jason1028kr,
djsly,
phealy,
r2k1 and
timmy-wright
as code owners
October 30, 2024 23:58
r2k1
reviewed
Oct 31, 2024
node-bootstrapper/parser/parser.go
Outdated
@@ -185,6 +186,7 @@ func BuildCSECmd(ctx context.Context, config *nbcontractv1.Configuration) (*exec | |||
for k, v := range getCSEEnv(config) { | |||
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", k, v)) | |||
} | |||
sort.Strings(cmd.Env) // produce deterministic output | |||
cmd.Env = append(cmd.Env, os.Environ()...) // append existing environment variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, it would take me ages to find this. Good catch. I didn't expect we need env variables from somewhere else.
Btw, I think it should be:
sort.Strings(cmd.Env)
cmd.Env = append(os.Environ(), cmd.Env...)
In some edge cases we may want to override the ENV variable.
And I think the last one is more important
r2k1
approved these changes
Oct 31, 2024
lilypan26
added a commit
that referenced
this pull request
Oct 31, 2024
Co-authored-by: Lily Pan <[email protected]> Co-authored-by: r2k1 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What this PR does / why we need it:
Noticed scriptless e2es were failing now that bootstrap environment variables are generated in go binary #5176, Fixed by appending existing system environment variables before triggering bootstrap cmd.
Which issue(s) this PR fixes:
Fixes #
Requirements:
Special notes for your reviewer:
Release note: