From dea6a29367664f554f0ae45d535175cec3917849 Mon Sep 17 00:00:00 2001 From: Giovanni Guerrieri <49747129+Soap2G@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:11:56 +0100 Subject: [PATCH] Conditional poststarthook creation (#299) * Conditional poststarthook creation * adding env var check --- .../cluster/flux/jhub/jhub-release.yaml | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/infrastructure/cluster/flux/jhub/jhub-release.yaml b/infrastructure/cluster/flux/jhub/jhub-release.yaml index 057df9f..ca807ec 100644 --- a/infrastructure/cluster/flux/jhub/jhub-release.yaml +++ b/infrastructure/cluster/flux/jhub/jhub-release.yaml @@ -129,23 +129,28 @@ spec: command: - "sh" - "-c" - - > - mkdir -p /certs /tmp; - echo -n $RUCIO_ACCESS_TOKEN > /tmp/rucio_oauth.token; - echo -n "oauth2:${EOS_ACCESS_TOKEN}:iam-escape.cloud.cnaf.infn.it/userinfo" > /tmp/eos_oauth.token; - chmod 0600 /tmp/eos_oauth.token; - mkdir -p /opt/rucio/etc; - echo "[client]" >> /opt/rucio/etc/rucio.cfg; - echo "rucio_host = https://vre-rucio.cern.ch" >> /opt/rucio/etc/rucio.cfg; - echo "auth_host = https://vre-rucio-auth.cern.ch" >> /opt/rucio/etc/rucio.cfg; - echo "ca_cert = /certs/rucio_ca.pem" >> /opt/rucio/etc/rucio.cfg; - echo "account = $JUPYTERHUB_USER" >> /opt/rucio/etc/rucio.cfg; - echo "auth_type = oidc" >> /opt/rucio/etc/rucio.cfg; - echo "oidc_audience = rucio" >> /opt/rucio/etc/rucio.cfg; - echo "oidc_polling = true" >> /opt/rucio/etc/rucio.cfg; - echo "oidc_issuer = escape" >> /opt/rucio/etc/rucio.cfg; - echo "oidc_scope = openid profile offline_access" >> /opt/rucio/etc/rucio.cfg; - echo "auth_token_file_path = /tmp/rucio_oauth.token" >> /opt/rucio/etc/rucio.cfg; + - | + if [ "${SKIP_POSTSTART_HOOK}" = "true" ]; then + echo "hello world"; + else + mkdir -p /certs /tmp; + echo -n $RUCIO_ACCESS_TOKEN > /tmp/rucio_oauth.token; + echo -n "oauth2:${EOS_ACCESS_TOKEN}:iam-escape.cloud.cnaf.infn.it/userinfo" > /tmp/eos_oauth.token; + chmod 0600 /tmp/eos_oauth.token; + mkdir -p /opt/rucio/etc; + echo "[client]" >> /opt/rucio/etc/rucio.cfg; + echo "rucio_host = https://vre-rucio.cern.ch" >> /opt/rucio/etc/rucio.cfg; + echo "auth_host = https://vre-rucio-auth.cern.ch" >> /opt/rucio/etc/rucio.cfg; + echo "ca_cert = /certs/rucio_ca.pem" >> /opt/rucio/etc/rucio.cfg; + echo "account = $JUPYTERHUB_USER" >> /opt/rucio/etc/rucio.cfg; + echo "auth_type = oidc" >> /opt/rucio/etc/rucio.cfg; + echo "oidc_audience = rucio" >> /opt/rucio/etc/rucio.cfg; + echo "oidc_polling = true" >> /opt/rucio/etc/rucio.cfg; + echo "oidc_issuer = escape" >> /opt/rucio/etc/rucio.cfg; + echo "oidc_scope = openid profile offline_access" >> /opt/rucio/etc/rucio.cfg; + echo "auth_token_file_path = /tmp/rucio_oauth.token" >> /opt/rucio/etc/rucio.cfg; + fi; + networkPolicy: enabled: false storage: