Resolve the project url from the plain Host rule only - #152
Open
turegjorup wants to merge 2 commits into
Open
turegjorup wants to merge 2 commits into
turegjorup wants to merge 2 commits into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
idc urlreturns a malformed URL for any project whose nginx carries a second Traefik router, soidc openopens a blank browser tab.Changes
scripts/itkdev-docker-compose, theurlcase: the jq host pattern goes from^Host\(`(?<host>.+)`\)$to^Host\(`[^`]+`\)$in the filter, and the capture likewisetestcall; onlycaptureneeds itWhy
.matches a backtick, and.+is greedy, so the "bare Host rule" filter matched compound rules too. Giventhe pattern still matches — the value starts with
Host(`, ends with`), and.+swallows the`) && PathPrefix(`in between — so nothing gets filtered and the capture returns that whole middle section as the host.firstthen picks by label order, andtraefik.http.routers.itksites-health.rulesorts ahead oftraefik.http.routers.itksites.rule(-is 0x2D,.is 0x2E). Soidc urlprintedand
opencould not parse it. With[^`]+a backtick can no longer be consumed, the compound rule fails the closing anchor and is excluded, and the capture yields the hostname alone.Verified against devops_itksites, which has two such routers (
/cron-metricsand/health/detail):idc urlnow printshttp://itksites.local.itkdev.dkandidc openlands on the site.Worth noting the bug is invisible without
jqinstalled — that branch is skipped entirely and the script falls back toCOMPOSE_DOMAIN.