harbor icon indicating copy to clipboard operation
harbor copied to clipboard

Add default project when pulling from dockerhub without project name

Open stonezdj opened this issue 3 years ago • 1 comments

Check project is default project format in dockerhub Redirect blob/manifest request to default url Fixes #12719

Signed-off-by: stonezdj [email protected]

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #(issue)

Please indicate you've done the following:

  • [x] Well Written Title and Summary of the PR
  • [x] Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • [x] Accepted the DCO. Commits without the DCO will delay acceptance.
  • [x] Made sure tests are passing and test coverage is added if needed.
  • [x] Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

stonezdj avatar Sep 12 '22 02:09 stonezdj

Codecov Report

Merging #17537 (820ff29) into main (acc2872) will increase coverage by 0.17%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17537      +/-   ##
==========================================
+ Coverage   67.09%   67.26%   +0.17%     
==========================================
  Files         993      990       -3     
  Lines       83548    84073     +525     
  Branches     2665     2625      -40     
==========================================
+ Hits        56053    56551     +498     
- Misses      23616    23671      +55     
+ Partials     3879     3851      -28     
Flag Coverage Δ
unittests 67.26% <0.00%> (+0.17%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/server/middleware/repoproxy/proxy.go 2.48% <0.00%> (-0.46%) :arrow_down:
...rtal/src/app/shared/services/permission.service.ts 23.80% <0.00%> (-42.86%) :arrow_down:
src/portal/src/app/shared/units/cache-util.ts 19.35% <0.00%> (-32.26%) :arrow_down:
src/controller/quota/options.go 55.55% <0.00%> (-15.88%) :arrow_down:
src/pkg/scan/export/manager.go 58.33% <0.00%> (-12.32%) :arrow_down:
...t/artifact-list-page/artifact-list-page.service.ts 17.50% <0.00%> (-8.75%) :arrow_down:
...artifact-list-page/artifact-list-page.component.ts 32.25% <0.00%> (-6.21%) :arrow_down:
src/controller/event/handler/auditlog/auditlog.go 56.52% <0.00%> (-4.35%) :arrow_down:
...portal/src/app/shared/services/scanning.service.ts 20.83% <0.00%> (-4.17%) :arrow_down:
...ortal/src/app/shared/pipes/harbor-datetime.pipe.ts 32.00% <0.00%> (-4.00%) :arrow_down:
... and 68 more

codecov[bot] avatar Sep 12 '22 02:09 codecov[bot]

Shouldn't something like docker pull 10.192.203.193/redis:4.0 work now?

Building harbor from source and testing this PR results in an error: Error response from daemon: unknown: bad request: invalid repository name: redis

core.log logs an ERROR message containing: authutils.go:104]: Failed to handle the resource repository:redis, due to error unable to parse image from string: redis, returning empty access for it.

This error looks like it can be traced back to parseImg in creator.go, which can't account for this new acceptable pull format that this PR should enable.

AnishMadan avatar Nov 15 '22 03:11 AnishMadan