-
Notifications
You must be signed in to change notification settings - Fork 304
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
Allow list based config volumes
and volume_mounts
to be assigned dictionaries
#843
Conversation
Continue to support these values to be defined as Lists for backwards compatibility. When defined as Dicts, the items are sorted lexicographically by the keys and the values are used as volumes / volume mounts. This enables easy overriding or extension. refs NASA-IMPACT/veda-jupyterhub#44 (comment) jupyterhub/jupyterhub#4822
for more information, see https://pre-commit.ci
@yuvipanda Could you please take a look at these changes and let me know if they look good? If this looks ok, I'll proceed to make similar updates for other traitlets that need to support dictionaries. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor ask for a docstring, but otherwise this approach looks great to me.
Thank you for working on this, @sunu!
@@ -1869,6 +1891,12 @@ def _expand_all(self, src): | |||
else: | |||
return src | |||
|
|||
def _sorted_dict_values(self, src): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a docstring here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Thanks for the review @yuvipanda! I have added the missing docstring. I'll open a follow up PR to make similar updates for other traitlets that need to support dictionaries. |
Thanks @sunu! |
As a continuation of jupyterhub#843, allow more pod properties to be defined as dictionaries for easy overriding.
volumes
and volume_mounts
to be defined as Dicts
volumes
and volume_mounts
to be defined as Dictsvolumes
and volume_mounts
to be assigned dictionaries
I've made the following changes:
Union(trait_types=[List(), Dict()])
so that they can be defined as dictionaries (for easy overriding) or as lists (for backwards compatibility)Defining these values as dictionaries enables easy overriding. refs jupyterhub/jupyterhub#4822 and NASA-IMPACT/veda-jupyterhub#44