subprocess: Forward proxy env for postinstall script #37
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.
The proxy env vars for curl can be set up for the update-engine service but so far weren't forwarded to the postinstall script. Now that we download from it, we need to forward them.
Forward the env vars for curl and ue-rs download_sysext (Flatcar Stable currently uses curl, Alpha uses ue-rs).
How to use
Backport to Stable and LTS.
Testing done
Checked that these env vars pop up when set up. First I tested
with
sudo flatcar-update …
and it made one more env var entry (2 vars
). The same should happen for the proxy vars.With setting
Environment=HTTPS_PROXY=http://a.b
on a patched system and runningsudo ./flatcar-update -V 3850.0.0 -F
with this patch to have it download the payload as fallback:we see the
2 vars
strace log as well, indicating that the env var is forwarded, and we get a failed update because the fallback download can't reach https with a non-existing proxy:The same happens with
sudo ./flatcar-update -V 3760.2.0 -F
which uses curl instead of ue-rs (the error message iscurl: (5) Could not resolve proxy: a.b
).