I have JH 4.1.5 (using the helm chart v3.3.7) deployed in IBM Cloud OpenShift using keycloak as the authenticator and email as the username_claim. This is all working nicely and it creates private notebook PVCs of the format 'claim-{sanitised username} where {sanitised-username} has the @ and . symbols replaced with -40 and -2e respectively.
But… with the development version of JH 5.1 it does not sanitise the username when building the PVC name which consequently fails in ROKS as the name must a-zA-z. The error is:
"kind":"PersistentVolumeClaim","causes":[{"reason":"FieldValueInvalid","message":"Invalid value: \"xxxxxx@bbbb.com\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character
How do I get around this? I need to continue to use email as the username_claim and the PVC name generated has to match that used by JH 4.1.5 so that I can upgrade and users will not loose all their data.
I have read some commentary about custom authenticators to sanitise the username but this will mean the username in the top right will be changed, plus the user prompt in a terminal etc. I am trying to minimize the impact to users.
I also understand this is the dev version and not a stable version. Could this be on the list for fixing for the stable version?
I am using the helm chart version 4.0.0-0.dev.git.6760.h7f442465 from the website. I have narrowed the issue some more. Its to do with the metadata.label being set to my username (aka email address), not the claim name as I said previously.
"kind":"PersistentVolumeClaim","causes":[{"reason":"FieldValueInvalid","message":"Invalid value: \"xxxxx@yyyy.com\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')","field":"metadata.labels"}]}
If I use surname for ex as the username_claim, then the metadata.label is set to the surname. Anyone know where I can overwrite this label?
I have added a pre-spawner hook to correct the PVC name to be consistent with JH 4.1.5 but now trying to work out where that label is coming from.
Im on mobile i cant check, but i think you are now using kubespawner beta1 with changes related to pvc naming
However, they were designed to be non breaking by remembering previous names etc, but by actively setting pvc_name the mitigation of the breaking change may have failed or been bypassed.