Commit Graph

60 Commits

Author SHA1 Message Date
Prima Adi Pradana
7b8a322a88
delete membership=0 in getProjectsByName (#20153)
delete membership=0 in getProjectsByName but lets getProjects still using membership=1 for reserve if getProjectsByName not found any

Signed-off-by: prima <prima101112@gmail.com>
2024-04-05 15:29:07 +00:00
zycupup
ee6f61c502
feat: volc cr adapter (#19456)
feat: support volcEngine replication

Signed-off-by: zhuyuchen.1 <zhuyuchen.1@bytedance.com>
2024-01-19 14:15:49 +08:00
MinerYang
b38de22054
bump golang 1.21.5 & fix golangci-lint error (#19722)
bump golang 1.21.5

update golangci-lint && fix revive error

fix white space lint

Signed-off-by: yminer <yminer@vmware.com>
2023-12-19 09:41:26 +08:00
Chlins Zhang
8c23bcdc54
fix: fix replication list projects with pure numberic name (#19090)
Quote the project name when listing projects in the replication, resolve
the issue of pure number name of project.

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-08-04 09:29:51 +08:00
cui fliter
e19ec9623b
Fix: fix function name in comments (#18726)
fix function name in comments

Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-31 10:26:19 +08:00
Viktor
f8e28dbede
Changed logic search projects in gitlab adapter (#18529)
* fix(gitlab): change logic search projects usage search_namespaces

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>

* tests(gitlab): remove old data and actualization test

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>

* refactor(gitlab): added debug log

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>
(cherry picked from commit 732806221b1c1633682fe1adad4cbcd3a4687d0b)

* lint(gitlab): fix import order

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>

---------

Signed-off-by: lxShaDoWxl <lxshadowxkingxl@gmail.com>
2023-05-15 13:59:13 +08:00
MinerYang
ebac530b46
add goheader linter settings (#18503)
fix files for goheader linter

fix copyright 2018/2019

Signed-off-by: yminer <yminer@vmware.com>
2023-04-25 11:18:42 +08:00
Wang Yan
60d9664cbc
fix accessory replication issue (#18471)
Fixes #18404
Support multiple level accessories replication.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-04-04 12:46:46 +08:00
Back Yu
fe236ecd2e
Support vpc and internal network (goharbor#17488) (#17489)
Signed-off-by: Back Yu <yhfszb@gmail.com>
2023-03-15 11:04:45 +08:00
Wang Yan
738fde7d3b
remove chartmuseum backend (#18191)
Harbor deprecates chartmuseum as of v2.8.0

Epic: https://github.com/goharbor/harbor/issues/17958

Discussion: https://github.com/goharbor/harbor/discussions/15057

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-02-16 18:11:05 +08:00
Caleb Lloyd
901cc17c67
aws auth use default creds when none are supplied (#17932)
Signed-off-by: Caleb Lloyd <caleblloyd@gmail.com>
Co-authored-by: Vadim Bauer <vb@container-registry.com>
2023-02-03 21:52:53 +01:00
MinerYang
62223bd36d
update golangci-lint for golang1.19 (#17817)
update golaci-lint for golang1.19

Signed-off-by: yminer <yminer@vmware.com>

update ci version to v1.50.1
2022-11-18 11:40:01 +08:00
yanggang
0f4e2daf4c
Replaced io/ioutil with "os / io" package. (#17792)
Signed-off-by: yanggang <gang.yang@daocloud.io>

update typo

Signed-off-by: yminer <yminer@vmware.com>

Signed-off-by: yminer <yminer@vmware.com>
Co-authored-by: Wang Yan <wangyan@vmware.com>
2022-11-17 10:02:29 +08:00
Chlins Zhang
c330b8c63a
feat: introduce the copy by chunk for replication (#17602)
1. Add sql migration to alter replication policy table
2. Implement the PullBlobChunk and PushBlobChunk for the underlying v2 registry client
3. Update image transfer logic to support copy by chunk
4. Update the replication policy API handler

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-11-01 11:19:17 +08:00
Vincent Ni
9c0275deb6
Fix ecr authorization token issue (#17645)
Signed-off-by: Vincent Ni <kangqini@amazon.com>
2022-10-18 11:09:58 +08:00
Vincent Ni
805a36e7f0
Fix Replication to Cross-account AWS ECR (#17583)
Replication to Cross-account AWS ECR
2022-09-30 09:07:47 +02:00
Vincent Ni
a3d96000f5
Fix cross account issue (#17533)
Signed-off-by: Vincent Ni <kangqini@amazon.com>
2022-09-15 14:25:41 +08:00
Loong Dai
09371b48e8
lint: sort imports (#17131)
* lint: add goimports

Signed-off-by: Loong Dai <loong.dai@intel.com>
2022-07-20 11:33:08 +08:00
Shengwen YU
315d8a8993
fix: update code in compliance with golangci-lint revive (#17087)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-07-01 14:52:47 +08:00
Shengwen YU
44bfb992f4
fix: update code for golangci-lint varcheck (#17045)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-21 16:56:36 +08:00
MinerYang
aab320591f
golangci-lint fix ineffassign (#17027)
Signed-off-by: yminer <yminer@vmware.com>

delete src/lib/redis/helper.go

Signed-off-by: yminer <yminer@vmware.com>
2022-06-21 12:01:59 +08:00
Shengwen YU
e9fca3de45
fix: refactor code for golangci-lint whitespace (#17005)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-16 17:42:46 +08:00
Shengwen YU
c2a9f5de64
fix: update code for golangci-lint gosimple (#16974)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-14 13:44:09 +08:00
Chenyu Zhang
6cfbf76781
fix(replication): azurecr replication with token (#16888) (#16947)
Fix azurecr use ACR token failed to list tags, the root cause is the
scope action of acr token is 'metadata_read' not 'pull' when list v2
tags API.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-06-13 10:05:05 +08:00
Shengwen YU
b43ba15f40
fix: golangci-lint errcheck (#16920)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-07 17:00:36 +08:00
Wang Yan
3eb668c0a4
fix replcation issue on accessory (#16912)
The tag/lable filter only works on the subject manifest, and if the subject manifest is mathed, all the accessories are marked as matched.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-27 01:36:38 +08:00
MinerYang
9d8e9158de
fix deadcode lint & update golangci-lint.yaml (#16896)
* fix deadcode lint & update golangci-lint.yaml

Signed-off-by: yminer <yminer@vmmware.com>

mock.go

Signed-off-by: yminer <yminer@vmmware.com>

commentfmt

Signed-off-by: yminer <yminer@vmmware.com>

mock.go update

Signed-off-by: yminer <yminer@vmmware.com>

update makefile

Signed-off-by: yminer <yminer@vmmware.com>

* update /pkg/allowlist/validator.go

Signed-off-by: yminer <yminer@vmmware.com>

Co-authored-by: yminer <yminer@vmmware.com>
2022-05-26 10:32:07 +08:00
Wang Yan
d26b5792c0
fix 16883 (#16911)
Fixes #16883, set the labels belonging to the subject manifest to the accessories on replication.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-26 01:30:53 +08:00
Wang Yan
d3d4ad6a34
fix staticcheck issues (#16828)
Fix the staticcheck problems that reported by golangci-line staticcheck

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-10 16:07:10 +08:00
Wang Yan
c333218ba2
fix close response missing (#16820)
It has to close the http response on deleting manifest

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-07 13:03:15 +08:00
疯魔慕薇
1c4495361b
Fix & UT (#16279)
1. Fix TCR Adapter namespcae check.
2. Add Chart UT.

Signed-off-by: 疯魔慕薇 <kfanjian@gmail.com>
2022-03-04 14:09:25 +08:00
He Weiwei
abd85284d2
feat: merge local and remote tags for repo of proxy cache project in list API (#16394)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2022-02-24 10:27:45 +08:00
Wang Yan
6ef4874011
fix replicate reference accessory (#16401)
fixes #16375

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-02-23 21:24:15 +08:00
chlins
b37a987073 fix: fix codeql alerts
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-02-15 17:25:02 +08:00
Chenyu Zhang
4ef2d65451
Merge pull request #16286 from chlins/fix/skip-replication-for-proxy-cache
fix: skip replication to proxy cache project
2022-02-07 17:06:03 +08:00
Wang Yan
0a183feab6
add cosign support in replication (#16282)
For the case Harbor-to-Harbor, the accessory can be replicated from source or to target.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-01-26 21:35:17 +08:00
chlins
b1afd2efb0 fix: skip replication to proxy cache project
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-01-26 17:24:39 +08:00
rao yunkun
ce6bf73884 Merge remote-tracking branch 'upstream/main' 2021-12-05 16:34:04 +08:00
chlins
f880bc3361 fix(replication): enhance the replication rule validation
Signed-off-by: chlins <chenyuzh@vmware.com>
2021-11-12 09:53:11 +08:00
Chenyu Zhang
3aa698c7c9
fix(replication): list projects before replicate to reduce create duplicate project and requests to target registry (#15934)
Signed-off-by: chlins <chenyuzh@vmware.com>
2021-11-08 10:39:58 +08:00
chlins
9e8218f63b fix: handle codeql golang security issues
Signed-off-by: chlins <chenyuzh@vmware.com>
2021-10-22 10:51:26 +08:00
Wang Yan
f9d1294b45
roll back the runner count (#15792)
It takes about 1 hour to perform data for 40000 repositories per performance testing.

Roll back the runner count to 100 could speed the data preparation time.
It's safe since it only takes 100 DB connection counts at most per execution per core.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-10-14 19:05:30 +08:00
Wang Yan
729d2e6590 fix replication DB connection issue
fixes #15736

For the current imple, the GetWorker() may hang when there is no worker available, and will not release the DB connection.
In this case, the DB connection could reach the up limit that leads to harbor core for service unavailable.

1, move GetWorker() in the goroutine, release the DB connection for API.
2, reduce the worker count per harbor-core from 1024 to 10.
3, reduce the runner count per worker to 30.

After above, the max connection per harbor-core should be 300.

Worker: To control how many replicaiton exectuions can have at most at the same time.
Runner: To control the speed to generate an jobservice replicaiton job.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-10-14 11:31:33 +08:00
Qian Deng
879eecc926 Refactor and Add trace to http Transport
* Refactor common http GetTransport function signature
* Remove redendent GetHTTPTransport and similar functions
* Update Authorized function signature to meet new HTTPTransport
* Add trace for default Transport

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Ziming Zhang
d62aaaa625 fix(replication) gitlab filters may not work
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2021-09-13 17:23:12 +08:00
yunkunrao
246d863c59 Refactor ping method into util pkg
Signed-off-by: yunkunrao <yunkunrao@gmail.com>
2021-08-19 21:57:25 +08:00
Ziming Zhang
698c336421 feat(replication) add exclude decoration in policy
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2021-08-17 14:19:13 +08:00
Shengwen Yu
766e953325 fix: update adapter ut (mock http requests)
Closes: #15318

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2021-07-22 19:45:36 +08:00
Wenkai Yin(尹文开)
f0e1ba4e1b
Merge pull request #15005 from ywk253100/210528_ns
Declare the capability of supported repository path component for registries
2021-05-31 15:53:40 +08:00
He Weiwei
c7a4af3170
test: mock the API requests for the huawei registry (#15009)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-28 17:09:48 +08:00