Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All-numeric Kubernetes namespaces cannot be used with odo although they are valid for K8s #5652

Closed
rm3l opened this issue Apr 11, 2022 · 2 comments
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.

Comments

@rm3l
Copy link
Member

rm3l commented Apr 11, 2022

/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:

[kind-local-k8s-cluster|5646] 
~/w/t/5620-devfile-with-container-component-command on  main [$?] via ☕ v17.0.2 on ☁️   
❯ odo dev     
  __
 /  \__     Developing using the my-component-with-command Devfile
 \__/  \    Namespace: 5646
 /  \__/    odo version: v2.5.0
 \__/

↪ Deploying to the cluster in developer mode
 ✗  Waiting for Kubernetes resources 
 ✗  Failed to create the component: component namespace "5646" is not valid, component namespace should conform the following requirements: 
- Contain at most 63 characters
- Contain only lowercase alphanumeric characters or ‘-’
- Start with an alphanumeric character
- End with an alphanumeric character
- Must not contain all numeric values

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#L1046

According 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:

ComponentSettings:
  Name: my-component-with-command
  Project: "5646"
  AppName: app
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 11, 2022
@rm3l rm3l mentioned this issue May 11, 2022
3 tasks
@rm3l rm3l added this to odo Project Oct 3, 2022
@rm3l rm3l moved this to To Do 📝 in odo Project Oct 3, 2022
@rm3l rm3l removed the status in odo Project Oct 3, 2022
@kadel kadel added the priority/Low Nice to have issue. It's not immediately on the project roadmap to get it done. label Feb 17, 2023
@github-actions
Copy link
Contributor

A friendly reminder that this issue had no activity for 90 days. Stale issues will be closed after an additional 30 days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 30, 2023
Copy link
Contributor

github-actions bot commented Dec 1, 2023

This issue was closed because it has been inactive for 30 days since being marked as stale.

@github-actions github-actions bot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Dec 1, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2023
@github-project-automation github-project-automation bot moved this to Done ✅ in odo Project Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
Archived in project
Development

No branches or pull requests

2 participants