notebooks/components/example-notebook-servers/rstudio/s6/cont-init.d/02-rstudio-env-fix

8 lines
423 B
Plaintext

#!/command/with-contenv bash
# rstudio terminal cant see environment variables set by the container runtime,
# this breaks kubectl, so we store the KUBERNETES_* env vars in Renviron.site
# NOTE: the `|| true` is needed because `grep` will exit with non-zero status for no matches
echo "INFO: adding KUBERNETES_* env vars to '${R_HOME}/etc/Renviron.site'..."
env | grep KUBERNETES_ >> "${R_HOME}/etc/Renviron.site" || true