Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
Set OpenShift env vars in main startup sh
Browse files Browse the repository at this point in the history
  • Loading branch information
vpavlin committed Jul 30, 2020
1 parent a294175 commit 5e1d4b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 0 additions & 7 deletions jupyterhub_config-workspace.sh
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
KUBERNETES_SERVER_URL="https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT"
OAUTH_METADATA_URL="$KUBERNETES_SERVER_URL/.well-known/oauth-authorization-server"
OAUTH_ISSUER_ADDRESS=`curl -ks $OAUTH_METADATA_URL | grep '"issuer":' | sed -e 's%.*https://%https://%' -e 's%",%%'`

export OPENSHIFT_URL=$OAUTH_ISSUER_ADDRESS
export OPENSHIFT_REST_API_URL=$KUBERNETES_SERVER_URL
export OPENSHIFT_AUTH_API_URL=$OAUTH_ISSUER_ADDRESS
8 changes: 8 additions & 0 deletions jupyterhub_config.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
KUBERNETES_SERVER_URL="https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT"
OAUTH_METADATA_URL="$KUBERNETES_SERVER_URL/.well-known/oauth-authorization-server"
OAUTH_ISSUER_ADDRESS=`curl -ks $OAUTH_METADATA_URL | grep '"issuer":' | sed -e 's%.*https://%https://%' -e 's%",%%'`

export OPENSHIFT_URL=$OAUTH_ISSUER_ADDRESS
export OPENSHIFT_REST_API_URL=$KUBERNETES_SERVER_URL
export OPENSHIFT_AUTH_API_URL=$OAUTH_ISSUER_ADDRESS

if [ x"$CONFIGURATION_TYPE" != x"" ]; then
if [ -f /opt/app-root/etc/jupyterhub_config-$CONFIGURATION_TYPE.sh ]; then
. /opt/app-root/etc/jupyterhub_config-$CONFIGURATION_TYPE.sh
Expand Down

0 comments on commit 5e1d4b5

Please sign in to comment.