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

Endpoint validation is stricter than it needs to be; breaks some use cases. #821

Closed
amisevsk opened this issue Apr 11, 2022 · 1 comment · Fixed by #822
Closed

Endpoint validation is stricter than it needs to be; breaks some use cases. #821

amisevsk opened this issue Apr 11, 2022 · 1 comment · Fixed by #822
Assignees
Labels
area/api Enhancement or issue related to the api/devfile specification kind/bug Something isn't working

Comments

@amisevsk
Copy link
Contributor

amisevsk commented Apr 11, 2022

/kind bug

Which area this bug is related to?

/area api

What versions of software are you using?

Operating System:
N/A

Go Pkg Version:
latest

Bug Summary

Describe the bug:

PR #702 changed how endpoints are validated, forbidding endpoints that use the same port within the same container. Some containers define multiple endpoints to isolate routes. For example, Eclipse Theia requires multiple routes on the same port:

  • endpoint theia listens on port 3100 and is the main endpoint for the editor
  • endpoint webviews listens on port 3100 and is used to show web content in the editor

This is required to isolate webviews from the editor itself.

To Reproduce:
Attempt to validate the theia devfile: https://che-plugin-registry-main.surge.sh/v3/plugins/eclipse/che-theia/next/devfile.yaml

Expected behavior

There's no a priori reason to forbid multiple endpoints with the same port, and it is only done to make naming pod endpoints easier. If multiple endpoints use the same port, the pod's port could just be named after the first one in the list.

Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable.

Validation outputs

2 errors occurred:
	* devfile contains multiple endpoint entries with same TargetPort: 3100
	* devfile contains multiple endpoint entries with same TargetPort: 3100

Suggestion on how to fix the bug

  • Allow multiple endpoints to use the same port number if they are attached to the same container (as before)
  • Name pod endpoints according to the first endpoint with that uses that port number.

Additional Information

This issue was only discovered recently in the DevWorkspace Operator, as updating the devfile/api dependency was blocked by #804

@openshift-ci openshift-ci bot added kind/bug Something isn't working area/api Enhancement or issue related to the api/devfile specification labels Apr 11, 2022
@amisevsk amisevsk self-assigned this Apr 11, 2022
@elsony
Copy link
Contributor

elsony commented Apr 11, 2022

Suggestion on how to fix the bug

  • Allow multiple endpoints to use the same port number if they are attached to the same container (as before)
  • Name pod endpoints according to the first endpoint with that uses that port number.

The proposed solution sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Enhancement or issue related to the api/devfile specification kind/bug Something isn't working
Projects
None yet
2 participants