Skip to content
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

Some _template options don't work when defined in profile_list profiles #761

Open
AlexHill opened this issue Jul 31, 2023 · 2 comments
Open
Labels

Comments

@AlexHill
Copy link

#528 touches on this but the issue is more general than described there.

Bug description

Some of the *_template options are expanded in KubeSpawner.__init__() and never again. Overriding them in profile_list profiles therefore doesn't work - you can override the template, but since the template has already been expanded, overriding doesn't produce the desired effect.

See e.g. pvc_name, which is set in init and then used in get_pod_manifest() as-is. Instead, I think pvc_name_template should be expanded in get_pod_manifest().

Expected behaviour

Expansion of templates should be deferred wherever possible so that their overridden values can be respected.

Actual behaviour

Some templates are expanded during init and never again, so overriding them has no effect.

How to reproduce

Deploy z2jh with

  singleuser:
    profileList:
      - display_name: Override test
        default: true
        kubespawner_override:
          service_account: default
          volumes:
            - name: user-home
              persistentVolumeClaim:
                claimName: override-claim-{userid}--{servername}
          volume_mounts:
            - name: user-home
              mountPath: /home/jovyan
          pvc_name_template: override-claim-{userid}--{servername}

And try to launch your server. It will fail, because the volume definitions are expanded after overrides are applied, but the PVC name is not.

@AlexHill AlexHill added the bug label Jul 31, 2023
@welcome
Copy link

welcome bot commented Jul 31, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@yuvipanda
Copy link
Collaborator

Thanks for opening this, @AlexHill! I agree it makes sense they shouln't be expanded in __init__. Do you think you would be able to make a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants