Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions kubespawner/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2166,11 +2166,11 @@ def _build_pod_labels(self, extra_labels):

def _build_common_annotations(self, extra_annotations):
# Annotations don't need to be escaped
annotations = {'hub.jupyter.org/username': self.user.name}
if self.name:
annotations['hub.jupyter.org/servername'] = self.name
annotations["hub.jupyter.org/kubespawner-version"] = __version__
annotations["hub.jupyter.org/jupyterhub-version"] = jupyterhub.__version__
annotations = {
'hub.jupyter.org/username': self.user.name,
"hub.jupyter.org/kubespawner-version": __version__,
"hub.jupyter.org/jupyterhub-version": jupyterhub.__version__,
}
Comment on lines -2169 to +2173
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change we wouldn't get the servername annotation on PVCs etc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PVCs are complicated because the template can be changed to create a shared or unshared volume.


annotations.update(extra_annotations)
return annotations
Expand Down Expand Up @@ -2285,6 +2285,8 @@ async def get_pod_manifest(self):
annotations = self._build_common_annotations(
self._expand_all(self.extra_annotations)
)
# Unconditionally put servername on the pods
annotations['hub.jupyter.org/servername'] = self.name
Comment on lines 2285 to +2289
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the unconditional assignment following right after calling _build_common_annotations should only be relevant if self.extra_annotations were declaring another hub.jupyter.org/servername, which would have a blank string value or similar.

        annotations = self._build_common_annotations(
            self._expand_all(self.extra_annotations)
        )
        # Unconditionally put servername on the pods
        annotations['hub.jupyter.org/servername'] = self.name

I wonder if its really a kubespawner issue, or z2jh / end-user issue based on this.


return make_pod(
name=self.pod_name,
Expand Down