-
Bug
-
Resolution: Done
-
Normal
-
None
-
False
-
None
-
False
-
Release Notes
-
Yes
-
-
-
-
-
-
No
-
-
Bug Fix
-
No
-
Yes
-
None
-
RHODS 1.19
-
High
Description of problem:
When adding an environment variable with only digits in the name, the build status freezes, and the notebook controller outputs this error:
1.663845121362662e+09 DEBUG events Warning {"object":
{"kind":"Notebook","namespace":"opendatahub","name":"jupyter-nb-lferrnan","uid":"49ea52f2-fabd-457c-94bd-988549fe3817","apiVersion":"kubeflow.org/v1beta1","resourceVersion":"618045"}, "reason": "FailedCreate", "message": "Reissued from statefulset/jupyter-nb-lferrnan: create Pod jupyter-nb-lferrnan-0 in StatefulSet jupyter-nb-lferrnan failed error: Pod \"jupyter-nb-lferrnan-0\" is invalid: spec.containers[0].env[2].name: Invalid value: \"1341\": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*')"}
We should have validation in the frontend to comply with this value.
Prerequisites (if any, like setup, operators/versions):
Steps to Reproduce
- Go to the spawner page
- Create a new env variable
- Fill it with digits, i.e. 1234
- Start the notebook, it will freeze and it won't output any error.
Actual results:
notebook spawn will freeze and it won't output any error.
Expected results:
When writing an env variable that starts with a number, have form validation.
Reproducibility (Always/Intermittent/Only Once):
always
Build Details:
Workaround:
Not using env variables that start with digits.
Additional info:
a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*')
Mirroring https://github.com/opendatahub-io/odh-dashboard/issues/586