-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix bug in parsing domain from repository reference #2979
Conversation
Please sign your commits following these rules: $ git clone -b "avtakkar/fix-domain-split" git@github.com:avtakkar/distribution.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
768fb69
to
e89db8d
Compare
Codecov Report
@@ Coverage Diff @@
## master #2979 +/- ##
==========================================
- Coverage 60.69% 60.64% -0.05%
==========================================
Files 102 102
Lines 8044 8044
==========================================
- Hits 4882 4878 -4
- Misses 2511 2514 +3
- Partials 651 652 +1
Continue to review full report at Codecov.
|
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.
Yeah. Another way to say it is when the first part of a ref is mixed case then you know that it must be a domain since repo names can't be mixed case.
LGTM
Change looks good, Can we get a test added to |
Signed-off-by: Aviral Takkar <aviral26@users.noreply.github.com>
7b0c107
to
a19e184
Compare
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.
LGTM
regexp.DomainRegexp
matches mixed-case and uppercase strings without.
as well. For example, in/v2/SAMPLE/reponame/manifests/latest
, the route handler would matchSAMPLE
asregexp.DomainRegexp
andreponame
asregexp.nameComponentRegexp
. To parse the normalized name, an uppercase or mixed-case string should be considered a valid domain.Fixes #2858
Redis cache enabled path invokes
ParseNormalizedName
which produces an error because rather than matchingTESTNAME
to the domain like the router does, it matchesTESTNAME/reponame
to the name component.