Skip to content

Commit 28abd71

Browse files
committed
fix(stack/signal-processing): Namespace interpolation
Add extraEnv for providing the templated namespace. We would use the downward api, but that breaks because the value of extraEnv is also passed to `hub` which expects a dict.
1 parent 006b2a0 commit 28abd71

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

stacks/signal-processing/jupyterhub.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,17 @@ options:
5858
# {% if DEMO is defined %}
5959
stackable.tech/demo: "{{ DEMO }}"
6060
# {% endif %}
61+
extraEnv:
62+
# Needed because the Notebook runs code to interpolate the Postgres DB hostname with a namespace.
63+
# We cannot use the downward API because some python code uses it and expects scalar values.
64+
# We also MUST use a dict, otherwise hub shows the following error:
65+
# traitlets.traitlets.TraitError: The 'environment' trait of a KubeSpawner instance expected a dict, not the list [{'name': 'NAMESPACE', 'value': 'my-namespace'}].
66+
# A helper in the chart formats these properly for any container env vars in Pods.
67+
NAMESPACE: "{{ NAMESPACE }}"
6168
initContainers:
6269
- name: download-notebook
6370
image: oci.stackable.tech/sdp/tools:1.0.0-stackable0.0.0-dev
6471
env:
65-
- name: NAMESPACE
66-
valueFrom:
67-
fieldRef:
68-
fieldPath: metadata.namespace
6972
# This file path needs adjustment for versioned demos on release branch
7073
command: ['sh', '-c', 'curl https://raw.githubusercontent.com/stackabletech/demos/refs/heads/fix/signal-processing-jupyterhub-chart/stacks/signal-processing/tsdb.ipynb -o /notebook/tsdb.ipynb']
7174
volumeMounts:

0 commit comments

Comments
 (0)