Open lahwaacz opened 1 month ago
We pass this in using a custom hook. For us this wouldn't remove our requirement for the hook so it's not a big deal, but it might work for you.
@jabbera Can you elaborate? Can you give an example of the custom hook, ideally?
@lahwaacz During configuration you can set:
c.Spawner.pre_spawn_hook = Your_pre_spawn_hook
async def Your_pre_spawn_hook(self, spawner: KubeSpawner) -> None:
spawner.init_containers[0]["env"] += [
V1EnvVar(name="JUPYTERHUB_USER", value=spawner.user.name),
V1EnvVar(name="JUPYTERHUB_SERVER_NAME", value=spawner.name),
]
I agree it's silly these are not set by default.
Proposed change
I would like to do some user-specific configuration in init containers. For this I need the current username on JupyterHub, which is normally set in the
JUPYTERHUB_USER
environment variable. However, it seems that init containers of the singleuser pod don't get any of theJUPYTERHUB_*
environment variables.Alternative options
None?
Who would use this feature?
(Optional): Suggest a solution