Skip to content

Commit

Permalink
Merge pull request #640 from yuvipanda/async
Browse files Browse the repository at this point in the history
Allow profile_options callable to be async
  • Loading branch information
GeorgianaElena committed Oct 2, 2022
2 parents ae66643 + d390f41 commit fa19acd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kubespawner/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,8 @@ def _validate_image_pull_secrets(self, proposal):
settings, on top of whatever was applied with the 'kubespawner_override' key
for the profile itself. The key should be the name of the kubespawner setting,
and value can be either the final value or a callable that returns the final
value when called with the spawner instance as the only parameter.
value when called with the spawner instance as the only parameter. The callable
may be async.
- `default`: (optional Bool) True if this is the default selected option
kubespawner setting overrides work in the following manner, with items further in the
Expand Down Expand Up @@ -3024,7 +3025,7 @@ async def _load_profile(self, slug, selected_profile_user_options):
]
for k, v in chosen_option_overrides.items():
if callable(v):
v = v(self)
v = await gen.maybe_future(v(self))
self.log.debug(
f'.. overriding traitlet {k}={v} for option {option_name}={chosen_option} from callabale'
)
Expand Down

0 comments on commit fa19acd

Please sign in to comment.