Skip to content

Require jupyter proxy only if jupyter should be installed

Currently this requireEnv is non-conditional and breaks when not defining the necessary Jupyter ENVs. Example configuration:

# .gitlab-ci.yml
include:
   - template: Managed-Cluster-Applications.gitlab-ci.yml

Failing apply Job excerpt

 Update Complete.
Listing releases matching ^certmanager$
No affected releases
Building dependency release=certmanager-issuer, chart=chart
No requirements found in chart/charts.
Listing releases matching ^certmanager-issuer$
No affected releases
Listing releases matching ^sentry$
No affected releases
Adding repo gitlab https://charts.gitlab.io
"gitlab" has been added to your repositories
Updating repo
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "gitlab" chart repository
...Successfully got an update from the "jetstack" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete.
Listing releases matching ^runner$
No affected releases
Adding repo cilium-gitlab git+https://gitlab.com/gitlab-org/defend/cilium@install/kubernetes?ref=v1.6.5-backport
"cilium-gitlab" has been added to your repositories
Updating repo
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "jetstack" chart repository
...Successfully got an update from the "gitlab" chart repository
...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "cilium-gitlab" chart repository
Update Complete.
Listing releases matching ^cilium$
No affected releases
in /usr/local/share/gitlab-managed-apps/helmfile.yaml: in .helmfiles[7]: in jupyterhub/helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:20:31: executing "stringTemplate" at <requiredEnv "JUPYTERHUB_PROXY_SECRET_TOKEN">: error calling requiredEnv: required env var `JUPYTERHUB_PROXY_SECRET_TOKEN` is not set
Uploading artifacts...
00:05
tiller.log: found 1 matching files                 
Uploading artifacts to coordinator... ok            id=332 responseStatus=201 Created token=EdzoRzLU
ERROR: Job failed: exit code 1

There's probably cleaner ways to do this but I went with the simplest. I think it could be worth writing some light wrapper around requiredEnv to make this less verbose but I decided to do the minimum to fix the current bug

Edited by Rémy Coutable

Merge request reports