Skip to content

Commit 23289b8

Browse files
authored
Merge pull request opendatahub-io#478 from atheo89/cherrypick-797
RStudio: added grabbing proxy-related env vars from container context setting them in R global env file
2 parents 073aaae + dc795de commit 23289b8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rstudio/rhel9-python-3.11/run-rstudio.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ do
2525
done
2626
# rstudio terminal cant see environment variables set by the container runtime
2727
# (which breaks kubectl, to fix this we store the KUBERNETES_* env vars in Renviron.site)
28-
env | grep KUBERNETES_ >> /usr/lib64/R/etc/Renviron.site
28+
# Also, we store proxy-related env vars lowercased by key so RStudio projects work with proxy by default
29+
env | grep "^KUBERNETES_" >> /usr/lib64/R/etc/Renviron.site
30+
env | grep "^HTTP_PROXY=" | tr '[:upper:]' '[:lower:]' >> /usr/lib64/R/etc/Renviron.site
31+
env | grep "^HTTPS_PROXY=" | tr '[:upper:]' '[:lower:]' >> /usr/lib64/R/etc/Renviron.site
32+
env | grep "^NO_PROXY=" | tr '[:upper:]' '[:lower:]' >> /usr/lib64/R/etc/Renviron.site
2933

3034
export USER=$(whoami)
3135

0 commit comments

Comments
 (0)