-
Notifications
You must be signed in to change notification settings - Fork 305
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 easily augmenting the pod config before launching #111
Conversation
This makes it easy for people to configure this without having to inherit from KubeSpawner and change it.
/cc @foxish for easier augmenting of pod specification. |
kubespawner/spawner.py
Outdated
|
||
This can be a coroutine if necessary. When set to none, no augmenting is done. | ||
|
||
This is very useful if you want to modify the pod being launched programattically. |
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.
nit: typo in "programattically"
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.
Fixed!
kubespawner/spawner.py
Outdated
@@ -909,6 +931,8 @@ def start(self): | |||
# FIXME: Have better / cleaner retry logic! | |||
retry_times = 4 | |||
pod = yield self.get_pod_manifest() | |||
if self.augment_pod: | |||
pod = self.augment_pod(self, pod) |
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.
Why also pass self
?
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.
So the augmenter can access other traitlets, and also call methods to get things like auth_state...
This is a good step towards more flexible parameterizing in the spawner. Thanks @yuvipanda |
It doesn't actually seem to exist in traitlets for some reason
np @foxish! Glad to help :) |
/cc @minrk too. I welcome some amount of bikeshedding on the name of this thing. |
There is some convention around calling configurable callables |
@minrk renamed! |
LGTM! |
This makes it easy for people to configure this without
having to inherit from KubeSpawner and change it.