-
Notifications
You must be signed in to change notification settings - Fork 792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix spawner env injection example. #2062
Fix spawner env injection example. #2062
Conversation
Thanks for pointing this out. The Would you mind sharing your full Z2JH config with secrets redacted so we can try and track down the bug(s)? |
proxy:
secretToken: "REDACTED"
https:
enabled: true
hosts:
- aimm-jupyter.blueskyproject.io
letsencrypt:
contactEmail: REDACTED
hub:
config:
GlobusOAuthenticator:
client_id: REDACTED
client_secret: REDACTED
oauth_callback_url: https://aimm-jupyter.blueskyproject.io/hub/oauth_callback
identity_provider: bnl.gov
JupyterHub:
authenticator_class: globus
extraConfig:
00-spawner-env-config: |
# This string will be accessible to any logged-in user.
c.KubeSpawner.environment = {"MONGODB_URI": "REDACTED"}
print(c.KubeSpawner.environment) |
Point 1 - Chart config value override with another typeI branched off point 1 to #2063, so let's focus only on point 2 and point 3 here. Point 2 - Use of
|
@danielballan this PR is addressing point 1-3, but I'm not willing to address point 1 without further investigation. I'd be happy to approve this PR for the example change from c.Spawner to c.KubeSpawner and from |
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
Thanks for the syntax fix. I too am confused by Point (3). I'm sure this kind of configuration merging has worked for me in other contexts, and the docs are really clear on this exact point. I just checked it again to be sure I wasn't getting confused. It is definitely the case that setting the config |
@danielballan could you open an issue in https://github.com/jupyterhub/kubespawner/issues/new? You could reference point 3 in this issue from there, but it would be good to have you describe there also what version of the Helm chart you've used. |
Thank you for your work investigating, reporting, and contributing with a change @danielballan!! ❤️ 🎉 |
I think there are three separate problems with the documented example for injecting an environment variable into the user container environment.
extraConfig
accepts either a dict of strings or a single string (of Python code), but it actually only accepts the first one. If you give it a single string, following the documented example, it warns+=
to update theSpawner.environment
configurable, but that is not a legal operation on a dict or on the corresponding Configurable object. The logs:c.Spawner.environment
has no effect on the environment. Instead,c.KubeSpawner.environment
must be used.I have confirmed that the revised example works as expected with Helm Chart version 0.11.1.