harbor icon indicating copy to clipboard operation
harbor copied to clipboard

Fix aliyun acr connect and replicate

Open bzd111 opened this issue 2 years ago • 3 comments

Signed-off-by: bzd111 [email protected]

Fix aliyun acr connect and replicate

Comprehensive Summary of your change

Issue being fixed

Fixes #13771 #15569

Aliyun ACR can't get authorization token use api version "2016-06-07", so I fix it use api version "2018-12-01". But api version "2018-12-01", need a param InstanceId that means acr instance id. you can find it in https://cr.console.aliyun.com/ And Only enterprise Enterprise Edition has instance id aliyun api doc I use makefile to build new harbor-core and harbor-jobservice, It works. image

bzd111 avatar Aug 01 '22 02:08 bzd111

Codecov Report

Merging #17285 (a7b6b51) into main (bbc7282) will decrease coverage by 28.24%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #17285       +/-   ##
===========================================
- Coverage   71.48%   43.24%   -28.25%     
===========================================
  Files         758      235      -523     
  Lines       70413    13183    -57230     
  Branches        0     2677     +2677     
===========================================
- Hits        50335     5701    -44634     
+ Misses      16517     7166     -9351     
+ Partials     3561      316     -3245     
Flag Coverage Δ
unittests 43.24% <ø> (-28.25%) :arrow_down:

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

Impacted Files Coverage Δ
src/core/service/token/authutils.go
src/pkg/reg/adapter/aliacr/adapter.go
src/pkg/reg/adapter/aliacr/auth.go
src/pkg/reg/adapter/aliacr/types.go
src/pkg/token/claims/robot/robot.go
src/pkg/token/claims/v2/claims.go
src/lib/cache/redis/util.go
src/controller/task/execution_controller.go
src/pkg/scheduler/periodic_job.go
src/pkg/retention/manager.go
... and 983 more

codecov[bot] avatar Aug 01 '22 02:08 codecov[bot]

@bzd111 Hi, bzd111, thanks for your contribution to harbor, but I've tried to replication with aliyun acr, it works normally, by the way, did you use enterprise edition and could you try to test replication by personal/free edition?

chlins avatar Aug 04 '22 02:08 chlins

Hi, bzd111, thanks for your contribution to harbor, but I've tried to replication with aliyun acr, it works normally, by the way, did you use enterprise edition and could you try to test replication by personal/free edition?

I use personal edition try to replication, in test connect page, return http code 500,get log {"code":"USER_NOT_EXIST","message":"user is not exist."} from harbor.

registry url: "cr.cn-hangzhou.aliyuncs.com" AK have all acr access.

bzd111 avatar Aug 05 '22 06:08 bzd111

@bzd111 Sorry, I can not reproduce the issue as you mentioned.

chlins avatar Sep 09 '22 02:09 chlins

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

github-actions[bot] avatar Nov 08 '22 09:11 github-actions[bot]

Thanks,I would close this issue.

bzd111 avatar Nov 08 '22 09:11 bzd111