Commit Graph

89 Commits

Author SHA1 Message Date
wang yan
71c769ec97 remvoe bypass to scanner pull
Signed-off-by: wang yan <wangyan@vmware.com>
2019-10-24 17:49:20 +08:00
wang yan
a6ad1b2db8 update code per review comments
Signed-off-by: wang yan <wangyan@vmware.com>
2019-10-23 20:05:51 +08:00
wang yan
2fa85aefca fix per comments
Signed-off-by: wang yan <wangyan@vmware.com>
2019-10-23 18:45:30 +08:00
wang yan
5996189bb0 update per comments and fix govet error
Signed-off-by: wang yan <wangyan@vmware.com>
2019-10-23 18:45:30 +08:00
wang yan
22b4ea0f89 Enable robot account bypass policy check
1, the commit is for internal robot to bypass policy check, like vul and signature checking.
2, add a bool attribute into registry token, decode it in the harbor core and add the status into request context.
3, add a bool attribut for robot API controller, but API will not use it.y

Signed-off-by: wang yan <wangyan@vmware.com>
2019-10-23 18:45:30 +08:00
wang yan
3e826c4e80 update query in the immutable delete manifest middleware
Signed-off-by: wang yan <wangyan@vmware.com>
2019-10-22 19:37:20 +08:00
wang yan
424f11e697 add immutable match in the repository/tag delete api
Signed-off-by: wang yan <wangyan@vmware.com>
2019-10-21 15:53:24 +08:00
Wenkai Yin(尹文开)
5c5e475da4
Merge pull request #9415 from steven-zou/fix/pluggable_scanner_policy_check
do changes to let the vul policy check compatible with new framework
2019-10-18 09:39:20 +08:00
wang yan
da02b820ad add immutable tag middleware
Signed-off-by: wang yan <wangyan@vmware.com>
2019-10-17 16:58:11 +08:00
Steven Zou
f18afc0a3f do changes to let the vul policy check compatiable with new framework
- update the scan/scanner controller
- enhance the report summary generation
- do changes to the vulnerable handler
- remove the unused clair related code
- add more UT cases
- update the scan web hook event
- drop the unsed tables/index/triggers in sql schema

Signed-off-by: Steven Zou <szou@vmware.com>
2019-10-16 23:15:26 +08:00
Wenkai Yin
a61c928e34 Check the existence of project before the next action
Fixes #8234, check the existence of project to avoid the panic

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-10-09 16:54:10 +08:00
He Weiwei
3e515bfabb feat(quota): skip to save blob size when quota disabled
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-09-25 09:19:20 +00:00
He Weiwei
d8c2bf6f86 fix(quota): handle range header missing in response
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-09-25 09:17:22 +00:00
Wang Yan
2194834b41
Merge pull request #8910 from heww/foreign-layers
fix(quota): correct size quota for image with foreign layers
2019-09-03 00:29:24 +08:00
He Weiwei
f44b75f398 fix(quota): correct size quota for image with foreign layers
1. Sync blobs from manifest for image with foreign layers.
2. Ignore size of foreign layers when compute size quota.
3. Fix repo info of artifact when upgrade from 1.8 version.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-09-02 14:10:58 +00:00
Wenkai Yin(尹文开)
d762e0730a
Merge pull request #8843 from heww/fix-chart-builder
fix(chart,quota): fix path regexp of chart creation and deletion
2019-09-02 15:59:18 +08:00
wang yan
dd9f028fe0 fix #8888
the image may has the same blobs as the references, which causes the artifact & blobs
can not be inserted by unique constraint

Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-30 15:30:05 +08:00
He Weiwei
1d8eac8cf4 fix(chart,quota): fix path regexp of chart creation and deletion
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-08-27 01:04:10 +00:00
wang yan
f343b2ec45 Revise quota errors to make it more readable
1, fix #8802, update the error formet
2, fix #8807, raise the real retag error to UI
3, fix #8832, raise the real chart error to chart client & ut

Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-26 17:00:31 +08:00
Wang Yan
299032d602
Merge pull request #8771 from wy65701436/fix-manifest-dup
fix quota count size for same manifest in different repo
2019-08-23 08:37:03 +08:00
wang yan
2d569192ab fix quota count size for same manifest in different repo
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-23 00:56:45 +08:00
wang yan
83a3274a96 fix #8688
use the docker defined error to avoid retry pushing on quota overflow

Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-22 19:19:43 +08:00
He Weiwei
c22bf2539e refactor(quota,middleware): skip overflow error when subtract resources
1. Skip overflow error when subtract resources
2. Take up resources before handle request and put it back when handle
failed for add action in quota interceptor
3. Free resources only after handle success for subtract action in quota
interceptor

Closes #8681

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-08-20 14:41:55 +00:00
He Weiwei
1bbfc023f1 fix(quota): fix computeResources method of qutoa interceptor
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-08-18 16:14:36 +00:00
wang yan
9601c9f206 Add log in quota size handler
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-14 14:10:09 +08:00
He Weiwei
c1cea42089 feat(quota,middleware): enable or disable quota per project by config
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-08-12 00:02:26 +00:00
He Weiwei
e62c29123d refactor(quota,middleware): implement size quota by quota interceptor
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-08-08 23:55:54 +00:00
He Weiwei
9778954852 feat(quota,middleware): image count quota support
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-08-01 14:48:59 +08:00
He Weiwei
8cc9314984
feat(helm-chart,quota): count quota support for helm chart (#8439)
* feat(helm-chart,quota): count quota support for helm chart

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-07-31 16:48:40 +08:00
wang yan
4410cc93f9 add internal reg request handler chain
this is for internal registry api call, the request should be intercpeted by quota middlerwares, like retag and delete.
Note: The api developer has to know that if the internal registry call in your api, please consider to use
NewRepositoryClientForLocal() to init the repository client, which can handle quota change.

Signed-off-by: wang yan <wangyan@vmware.com>
2019-07-30 19:39:56 +08:00
Wang Yan
ca20281b35
Merge pull request #8438 from wy65701436/fix-quota-bug
Fix logic error in quota middlewware on handling failure response
2019-07-29 16:02:57 +08:00
wang yan
1975f4a71d Fix logic error in quota middlewware on handling failure response
Signed-off-by: wang yan <wangyan@vmware.com>
2019-07-28 12:37:58 +08:00
wang yan
a23ff4e448 Update pull time in artifact table for docker image pull
Signed-off-by: wang yan <wangyan@vmware.com>
2019-07-28 12:30:20 +08:00
Wang Yan
1dfc47d24e Add size middleware to support quota
[Add]:
1, size middleware for quota size
2, count middleware for quota artifact count

[Support]:
1, put, patch, mount blob
2, put manifest

[Refactor]:
1, Add handle response for middlerware
2, Remove the modifyResponse for registry proxy
3, Use the custom response writer to recored status

Signed-off-by: wang yan <wangyan@vmware.com>
2019-07-26 00:28:36 +08:00
Wang Yan
8ac6bdbbb0 Add quota workflow for quota
1, apply count for manifest if it's a new image
2, insert data for artifact and artifact_blob

Signed-off-by: wang yan <wangyan@vmware.com>
2019-07-16 14:48:05 +08:00
wang yan
f066d986b9 merge with latest master code 2019-07-11 20:21:15 +08:00
wang yan
7b38389898 update codes per review comments
Signed-off-by: wang yan <wangyan@vmware.com>

fix middlewares per review comments
1, add scheme1 and scheme2 check
2, change MustCompile to Compile

Signed-off-by: wang yan <wangyan@vmware.com>
2019-07-09 11:08:19 +08:00
wang yan
b3c5137a2f add copyright and fix codecy
Signed-off-by: wang yan <wangyan@vmware.com>
2019-07-09 11:08:19 +08:00
wang yan
57821b1b4c Refactor interceptors code with chain
1, add a blob inteceptors for quota usage
2, add a manifest inteceptors for quota usage

Signed-off-by: wang yan <wangyan@vmware.com>
2019-07-09 11:08:11 +08:00