Skip to content

Conversation

yuvipanda
Copy link
Collaborator

  • Matches behavior of what we do with servername in labels
  • Labels are escaped while annotations are not, making annotations suitable for filtering in metrics and dashboards

- Matches behavior of what we do with servername in labels
- Labels are escaped while annotations are not, making annotations
  suitable for filtering in metrics and dashboards
Comment on lines 2285 to +2289
annotations = self._build_common_annotations(
self._expand_all(self.extra_annotations)
)
# Unconditionally put servername on the pods
annotations['hub.jupyter.org/servername'] = self.name
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.

Comment on lines -2169 to +2173
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__,
}
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants