-
Notifications
You must be signed in to change notification settings - Fork 88
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
Update how too-long endpoint hostnames are handled #1801
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about sorting endpoints by theirs names here [1] instead of changing host names?
I just have some concerns, maybe someone relies on hostnames.
[1]
che-operator/controllers/devworkspace/solver/che_routing.go
Lines 485 to 486 in 7c7bd4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered sorting the endpoints instead of this approach, but honestly iterating through a map in sorted order in Go is annoying (since there's no way to easily get a keyset, etc.) :)
These hostnames are not going to be reliably static in any case since this functionality is triggered only when the default endpoint name becomes too long. For example, some users might see the normal format while others see the legacy format (depending on how long usernames are). You could even end up in a situation where half your endpoints are normal, and half are legacy. In the past, we've pointed people at the
endpoint-url
attribute to determine the actual hostname used for each devfile endpoint.I'm fine with sorting the endpoints, though I had a small concern that I was missing something in how they're handled, as the original issue has
order
numbers going up to 13 (which may just be how many endpoints the devfile has, I don't know).An additional bonus of doing it this way is that we don't run into situations where endpoints could be updated unexpectedly -- e.g. with order, even sorted, if you update the devfile to have an endpoint earlier in the order, all your legacy-hostname endpoints might change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for explanation, make sense to me.