From b100071e9961fa53b5146cab29a9a83ea5c93444 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Wed, 8 Nov 2023 12:15:08 +0530 Subject: [PATCH] Update comment about why we save pod_name in db state --- kubespawner/spawner.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kubespawner/spawner.py b/kubespawner/spawner.py index bd4eddce..a69f71dd 100644 --- a/kubespawner/spawner.py +++ b/kubespawner/spawner.py @@ -2128,12 +2128,8 @@ def get_state(self): """ Save state required to reinstate this user's pod from scratch - We save the `pod_name`, even though we could easily compute it, - because JupyterHub requires you save *some* state! Otherwise - it assumes your server is dead. This works around that. - - It's also useful for cases when the `pod_template` changes between - restarts - this keeps the old pods around. + `pod_name` is saved as `pod_template` can change between hub restarts, + and we do not want to lose track of the old pods when that happens. We also save the namespace and DNS name for use cases where the namespace is calculated dynamically, or it changes between restarts.