Skip to content

Commit

Permalink
Merge pull request #677 from dolfinus/save_dns_name
Browse files Browse the repository at this point in the history
Save dns_name between restarts
  • Loading branch information
minrk committed Nov 28, 2022
2 parents 9715f95 + 202a1f4 commit 98c289d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kubespawner/spawner.py
Expand Up @@ -2190,12 +2190,13 @@ def get_state(self):
It's also useful for cases when the `pod_template` changes between
restarts - this keeps the old pods around.
We also save the namespace for use cases where the namespace is
calculated dynamically.
We also save the namespace and DNS name for use cases where the namespace is
calculated dynamically, or it changes between restarts.
"""
state = super().get_state()
state['pod_name'] = self.pod_name
state['namespace'] = self.namespace
state['dns_name'] = self.dns_name
return state

def get_env(self):
Expand Down Expand Up @@ -2229,6 +2230,9 @@ def load_state(self, state):
if 'namespace' in state:
self.namespace = state['namespace']

if 'dns_name' in state:
self.dns_name = state['dns_name']

@_await_pod_reflector
async def poll(self):
"""
Expand Down

0 comments on commit 98c289d

Please sign in to comment.