All-numeric Kubernetes namespaces cannot be used with odo
although they are valid for K8s
#5652
Labels
kind/bug
Categorizes issue or PR as related to a bug.
lifecycle/rotten
Denotes an issue or PR that has aged beyond stale and will be auto-closed.
lifecycle/stale
Denotes an issue or PR has remained open with no activity and has become stale.
priority/Low
Nice to have issue. It's not immediately on the project roadmap to get it done.
/kind bug
What versions of software are you using?
Operating System:
Fedora 35
Output of
odo version
:odo v2.5.0
(40f55eb)How did you run odo exactly?
I tried to create and switch to a dedicated namespace named after an issue number, say
5646
.kubectl
created the namespace without any issue, and I can easily use it.However, running
odo dev
did not succeed, with the following validation errors:Expected behavior
It is clearly stated in the output that the namespace
must not contain all numeric values
, but I don't understand why we have such a requirement because the namespace name I tried to use is, I think, a valid RFC 1123 DNS name, as expected by Kubernetes.Maybe there is a valid (but undocumented) reason for that limitation?
Any logs, error output, etc?
The validation error comes from a function located in the
devfile/library
library: https://github.com/devfile/library/blob/main/pkg/util/util.go#L1046According to @feloy, the validation was introduced in #2699.
Also, we would need to beware of potential side effects, especially when handling YAML files.
As a side note, the
odo dev
command run above correctly quoted the namespace value in the.odo/env/env.yaml
file after creating the file:The text was updated successfully, but these errors were encountered: