Skip to content

Commit 5721e3e

Browse files
committed
RStudio: added grabbing proxy-related env vars from container context, setting them in R global env file.
Also changed env var search to beginning-of-line regex format for all env vars. Signed-off-by: shalberd <[email protected]>
1 parent b7cf0ba commit 5721e3e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rstudio/c9s-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)