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

url create should validate host format #3589

Closed
metacosm opened this issue Jul 16, 2020 · 0 comments · Fixed by #3591
Closed

url create should validate host format #3589

metacosm opened this issue Jul 16, 2020 · 0 comments · Fixed by #3591
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@metacosm
Copy link
Contributor

/kind bug

What versions of software are you using?

Operating System:
macOS

Output of odo version:
odo v1.2.3 (9be483f)

How did you run odo exactly?

odo url create --host https://127.0.0.1:60104 --ingress

Actual behavior

URL was accepted

Expected behavior

URL should report an error that the format is not appropriate similar to what happens during push

Any logs, error output, etc?

No, though subsequent odo push fail with:

Applying URL changes
 ✗  Failed To Update Config To Component Deployed.
Error: unable to create ingress: error creating ingress: Ingress.extensions "java-quarkus-8080" is invalid: spec.rules[0].host: Invalid value: "java-quarkus-8080.https://127.0.0.1:60104": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 16, 2020
metacosm added a commit to metacosm/odo that referenced this issue Jul 16, 2020
- Avoid checking for devfile / docker / experimental all the time
- Aggregate validation errors so that all are reported at once
- Fixes redhat-developer#3589
metacosm added a commit to metacosm/odo that referenced this issue Jul 16, 2020
- Avoid checking for devfile / docker / experimental all the time
- Aggregate validation errors so that all are reported at once
- Fixes redhat-developer#3589
@metacosm metacosm mentioned this issue Jul 16, 2020
3 tasks
metacosm added a commit to metacosm/odo that referenced this issue Jul 21, 2020
- Avoid checking for devfile / docker / experimental all the time
- Aggregate validation errors so that all are reported at once
- Fixes redhat-developer#3589
openshift-merge-robot pushed a commit that referenced this issue Jul 22, 2020
* feat: add ValidateHost function

* feat: optimize validation of URLs before creation

- Avoid checking for devfile / docker / experimental all the time
- Aggregate validation errors so that all are reported at once
- Fixes #3589

* fix: also check tls-secret in validate and report error if needed

* chore: add tests, in particular to check compound errors

* fix: comment out tests that only pass in experimental mode

* fix: move URL tests to appropriate location

* fix: adjust test for error format change
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants