OSC / ood_core

Open OnDemand core library
https://osc.github.io/ood_core/
MIT License
10 stars 29 forks source link

Kubernetes Per User Resource does not support "." in user names. #852

Open yhal-nesi opened 3 months ago

yhal-nesi commented 3 months ago

Dot is a perfectly legal and common character in posix username, but it is used to generate a kubernetes namespace name and kubernetes doesn't allow dots.

Looks like there is one place where it needs to be adjusted? https://github.com/OSC/ood_core/blob/master/lib/ood_core/job/adapters/kubernetes/batch.rb#L274

as well as the bootstrap script https://github.com/OSC/ondemand/blob/master/hooks/k8s-bootstrap/k8s-bootstrap-ondemand.sh

johrstrom commented 3 months ago

hi thanks for the bug report. Seems like we need to sanitize to -?

yhal-nesi commented 3 months ago

An example of how JupyterHub deals with K8 name generation: https://github.com/jupyterhub/kubespawner/blob/main/kubespawner/slugs.py And this is the kind of names that get generated: https://github.com/jupyterhub/kubespawner/blob/main/tests/test_slugs.py#L6