Commit Graph

475 Commits

Author SHA1 Message Date
DQ
4ac145b45b Fix: Add authenticate to projects head
Project head only allow authenticated user to call.

Signed-off-by: DQ <dengq@vmware.com>
2019-09-06 14:50:47 +08:00
gklp
dee3defeff refactored
Signed-off-by: gklp <gokalpkuscu@gmail.com>
2019-09-03 21:46:52 +03:00
wang yan
d8e17b122e add read only for quota switcher
Signed-off-by: wang yan <wangyan@vmware.com>
2019-09-03 14:08:39 +08: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(尹文开)
7d151946e0
Merge pull request #8917 from reasonerjt/fix-create-admin-user
Disallow creating an admin user when registration
2019-09-02 18:43:41 +08: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
Iradier, AlvaroJose
bf9ac08c89 Handle error on OIDC callback
If wrong OIDC scopes are defined, or there are some configuration errors, the OIDC callback query string might contain "error=..." with an error message. Intercept this case and show an error to the user instead of trying to exchange the token with a missing "code" parameter.

Signed-off-by: Iradier, AlvaroJose <AlvaroJose.Iradier@adidas.com>

Change error variable name

Signed-off-by: Iradier, AlvaroJose <AlvaroJose.Iradier@adidas.com>
2019-08-30 13:44:12 +02:00
Wenkai Yin(尹文开)
8c67f71b5e
Merge pull request #8902 from wy65701436/fix-8888
fix #8888
2019-08-30 18:09:56 +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
Wang Yan
240b718508
Merge pull request #8887 from wy65701436/fix-8886
fix(quota/sync) #8886
2019-08-30 15:06:35 +08:00
wang yan
16b910e1cf fix(quota/sync) #8886
The foreign layer won't be counted into project quota
NOTE: the foreign layer will be dumped from the registry in the migration

Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-29 17:29:40 +08:00
Ziming Zhang
8fb6e2f65b verify permission of GetRetentionExecTaskLog
Signed-off-by: Ziming Zhang <zziming@vmware.com>
Change-Id: I4bf4ddf3d3ed6f07a4618e242e2f3774996716d6
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2019-08-29 15:01:53 +08:00
Wang Yan
db5781bf78
Merge pull request #8860 from wy65701436/fix-quota-sync
fix quota sync issues
2019-08-29 13:45:38 +08:00
wang yan
5decb56369 update code per review comments
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-29 12:46:42 +08:00
wang yan
942e793f20 fix quota sync issues
1, fix #8858, add retry to ping backend service
2, fix #8859, split the blobs data when larger then 65535

Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-28 18:59:25 +08:00
Daniel Jiang
b6db8a8a10 Disallow creating an admin user when registration
This commit enhance the `POST /api/users` API to block request from non-admin to create
admin user.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2019-08-28 18:30:27 +08:00
Qian Deng
ed54b1da45
Merge pull request #8857 from wy65701436/fix-syne-readonly
fix quota sync read only setting
2019-08-28 17:04:02 +08:00
Ziming
94138137d5
add valid for rule (#8846)
Change-Id: I82215a0cf1ec32a253c8db9bfafe7e25b26c9ad9
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2019-08-28 16:58:49 +08:00
wang yan
19a37282c1 fix quota sync read only setting
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-28 14:53:01 +08:00
Wang Yan
87893abc5e
Merge pull request #8829 from ywk253100/190822_retry_status
Add status revision to handle retrying in replication task
2019-08-28 10:55:13 +08:00
Qian Deng
ea33561d95
Merge pull request #8747 from 928234269/patch1
fixt typo "an user" to "a user"
2019-08-27 18:26:11 +08:00
Wang Yan
be1e702d9d
Merge pull request #8787 from cd1989/core-hunging
Fix core hung when stop problem
2019-08-27 15:56:21 +08:00
Wenkai Yin
7924f37d86 Add status revision to handle retrying in replication task
Add status revision to handle retrying in replication task

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-08-27 14:17:11 +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
e7488e37b6
Merge pull request #8788 from bitsf/tag_retention_validate_model
add tag retention model test
2019-08-23 13:57:51 +08:00
Ziming Zhang
39db65e90f add tag retention model test
Signed-off-by: Ziming Zhang <zziming@vmware.com>
Change-Id: I3f8b06b994024fe6052b0dee87600ed932edaaff
2019-08-23 13:24:28 +08:00
mmpei
d5f87063e4
Merge branch 'master' into official-wehook-events-20190811 2019-08-22 22:07:12 -05:00
Wang Yan
35e786e54c
Merge pull request #8794 from ywk253100/190822_retry_status
Add status revision to retention task to handle retrying
2019-08-23 10:54:35 +08:00
peimingming
599d12a04d Fix bugs by comments for webhook
Signed-off-by: peimingming <peimingming@corp.netease.com>
2019-08-23 09:44:51 +08:00
cd1989
4b59346423 Exist core when signal received
Signed-off-by: cd1989 <chende@caicloud.io>
2019-08-23 09:34:41 +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
Wenkai Yin
661470e7bc Add status revision to retention task to handle retrying
Add status revision to retention task to handle retrying

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-08-22 20:04:25 +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
Wenkai Yin(尹文开)
21f8290110
Merge pull request #8777 from heww/issue-8635
fix(rbac): NewProjectNamespace in rbac only accept projectID
2019-08-22 17:52:27 +08:00
wang yan
dfa4301b21 fix deleted project error when to migrate quota
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-22 14:51:26 +08:00
Wenkai Yin(尹文开)
6198ed2634
Merge pull request #8758 from heww/issue-8681
refactor(quota,middleware): skip overflow error when subtract resources
2019-08-22 13:54:01 +08:00
He Weiwei
8effdc6f18 fix(rbac): NewProjectNamespace in rbac only accept projectID
Closes #8635

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-08-21 19:37:28 +00:00
Ziming Zhang
06e9467b06 1. remove rule none
2. change rule orders
3. remove laber selector

Change-Id: Idc18a27cb0267f5f5c80a04b381e4a5dc6998508
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2019-08-21 20:24:33 +08:00
Wang Yan
c1ad0518c9
Merge pull request #8582 from ethan-daocloud/patch-1
core/main.go: logging message correction
2019-08-21 13:49:00 +08:00
928234269
7a4fde5ec9
fixt typo "an user" to "a user"
Signed-off-by: 928234269 <longfei.shang@daocloud.io>
2019-08-21 10:20:35 +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
Steven Zou
217252a097
Merge pull request #8675 from ywk253100/190814_retention_task
Handle the retention task status updating in concurrency
2019-08-20 17:07:21 +08:00
Steven Zou
f6067d5474
Merge pull request #8708 from bitsf/tag_retention_rule_conflict
fix rule conflict, id error
2019-08-20 16:45:21 +08:00
Wang Yan
92fa01d6cd
Merge pull request #8733 from ywk253100/190819_label
Fix bug of listing tags filtered by label
2019-08-20 14:17:41 +08:00
Wenkai Yin(尹文开)
29ab93ad9c
Merge pull request #8714 from ywk253100/190816_scheduler
Fix bug found in scheduler
2019-08-20 14:11:04 +08:00
Wenkai Yin(尹文开)
0086d1b211
Merge pull request #8586 from ethan-daocloud/patch-2
project_test.go: many typos "respose" fixup
2019-08-20 13:54:37 +08:00
Wang Yan
f930786050
Merge pull request #8725 from heww/issue-8701
fix(quota): fix computeResources method of qutoa interceptor
2019-08-20 11:29:59 +08:00
Daniel Jiang
f10fb67d6d
Merge pull request #8662 from stonezdj/email_sec2
Set default email to null if not provided
2019-08-20 09:01:50 +08:00
Wenkai Yin
a5d292c9c6 Fix bug of listing tags filtered by label
Fixes #8249

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-08-19 16:10:16 +08:00
stonezdj
5fa8eb7854 Set default email to null if not provided
Signed-off-by: stonezdj <stonezdj@gmail.com>
2019-08-19 15:20:44 +08:00
Daniel Jiang
b3abd0316b
Merge pull request #8713 from reasonerjt/fix-8702
Avoid overwriting system CVE whitelist by mistake
2019-08-19 01:42:58 +08: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
b9d6108624 add ping for adapter to wait for service ready
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-16 16:03:12 +08:00
wang yan
6e11ecc6fc Update codes per review comments
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-16 14:58:52 +08:00
Wang Yan
7a41d89ac8 Add quota sync api toi to sync quota data with backend storage
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-16 14:55:46 +08:00
Daniel Jiang
022d4e6ae8
Merge pull request #7462 from cd1989/enable-tags-detail-param
List simple tags when detail set to false
2019-08-16 14:25:29 +08:00
Wenkai Yin
5c286d799f Fix bug found in scheduler
The scheduler hook handler doesn't parse the job status struct when handling the hook. This commit fixes it.

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-08-16 13:54:57 +08:00
Daniel Jiang
30bb2ddcdf Avoid overwriting system CVE whitelist by mistake
Fixes #8702
Also enforce the code to mitigate the potential risk.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2019-08-16 13:28:16 +08:00
Ziming
c279b7f3e9
fix retention rule compute error (#8664)
Change-Id: I16d7284b17508885e136f2d9ea5651978ba4a6d8
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2019-08-15 20:12:59 +08:00
Ziming Zhang
4dc6f12784 fix rule conflict, id error
Signed-off-by: Ziming Zhang <zziming@vmware.com>
Change-Id: I379f3c29cee742d346fb57ade397be64fd76f59d
2019-08-15 20:11:30 +08:00
Wenkai Yin
48b067f596 Handle the retention task status updating in concurrency
Compare the status code when updating retention task status to avoid the concurrent issue

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-08-15 18:36:18 +08:00
Ziming Zhang
f854d4a25d add always rule again
Signed-off-by: Ziming Zhang <zziming@vmware.com>
Change-Id: I34bac3b73e693b89e0b9debb28617352656ed1d9
2019-08-15 15:26:22 +08:00
Ziming
4944799f70
Merge pull request #8651 from bitsf/remove_tagretention_always
remove tag retention rule always
2019-08-15 14:35:26 +08:00
Wang Yan
bf0b5a3fd0
Merge pull request #8663 from wy65701436/fix-quota-api
Fix quota switch fail to get project size
2019-08-15 10:49:49 +08:00
Qian Deng
4611630ab6
Merge pull request #8616 from heww/db-connection-pool
feat(configuration,db): connection pool configs for db
2019-08-15 09:48:20 +08:00
Daniel Jiang
b0c8561b54
Merge pull request #8189 from mmpei/8162-optimize-manifest-wait
Optimize fetch manifest loop when handling notification
2019-08-15 00:29:53 +08:00
Daniel Jiang
d9e1b90c5b
Merge pull request #8653 from vmlaguna/vmlaguna/template-fix
Close <a> tag in error template
2019-08-15 00:11:28 +08:00
wang yan
a947a4259d Fix quota switch fail to get project size
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-14 22:32:32 +08:00
Wang Yan
54cb39b7a7
Merge pull request #8655 from wy65701436/log-size
Add log in quota size handler
2019-08-14 16:09:45 +08:00
Pedro Laguna
3c34675e0f Close <a> tag in error template
The error template is missing a closing <a> tag in the link to the harbor portal.

Signed-off-by: Pedro Laguna <44469313+vmlaguna@users.noreply.github.com>
2019-08-14 08:37:44 +01:00
He Weiwei
98e1f68468 feat(configuration,db): connection pool configs for db
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-08-14 14:30:34 +08: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
wang yan
838a923d23 fix code by review
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-14 12:47:12 +08:00
wang yan
9e0addee55 Enable usage sync when switch quota setting
Signed-off-by: wang yan <wangyan@vmware.com>
2019-08-14 12:47:12 +08:00
Ziming Zhang
d7e9924a01 remove tag retention rule always
Signed-off-by: Ziming Zhang <zziming@vmware.com>
Change-Id: Ide98d58f64596e8110fbb9eb0d73df6ccbd99c80
2019-08-13 21:10:57 +08:00
Steven Zou
1adc3a9469
Merge pull request #8606 from ywk253100/190807_stuck
Fix replication tasks stuck in "InProgress" issue
2019-08-13 15:59:20 +08:00
cd1989
da370bb331 List simple tags when detail set to false
Signed-off-by: cd1989 <chende@caicloud.io>
2019-08-12 15:16:19 +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
peimingming
222c47142a Add chart and scanning event for webhook
Signed-off-by: peimingming <peimingming@corp.netease.com>
2019-08-11 18:01:07 +08:00
Wang Yan
54a39c7159
Merge pull request #8597 from heww/size-quota
refactor(quota,middleware): implement size quota by quota interceptor
2019-08-09 15:44:33 +08:00
Steven Zou
d2fbb98a8d
Merge pull request #8592 from bitsf/tag_retention_conflict_rule
check rule conflict
2019-08-09 13:59:46 +08: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
Wenkai Yin
8777c07d47 Fix replication tasks stuck in "InProgress" issue
Fix replication tasks stuck in "InProgress" issue

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-08-08 15:42:42 +08:00
Ziming Zhang
fb5acdc64b check rule conflict
Signed-off-by: Ziming Zhang <zziming@vmware.com>
Change-Id: Iea8c9ff4702873cb4ab3ebd943deec22bec418e6
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2019-08-08 14:23:53 +08:00
guanxiatao
e7fafd1941 webhook policy, job, event support
Signed-off-by: guanxiatao <guanxiatao@corp.netease.com>
2019-08-07 20:30:26 +08:00
Ziming Zhang
730d95edc8 check rule conflict
Signed-off-by: Ziming Zhang <zziming@vmware.com>
Change-Id: I95f7e683b30fa6059b5bb49a2fc8f78dd7276079
2019-08-07 17:52:47 +08:00
Steven Zou
f3ba25f656
Merge pull request #8536 from bitsf/tag_retention_task_num
add task retain num
2019-08-07 17:39:39 +08:00
Ziming Zhang
3b62addc76 check rule conflict
Signed-off-by: Ziming Zhang <zziming@vmware.com>
Change-Id: I8af648f22aa3fe76024240d322a7fdae560e3fbd
2019-08-07 15:38:21 +08:00
ethan
f463b7c449 project_test.go: many typos "respose" fixup
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-07 13:39:05 +08:00
Wenkai Yin
216ef269b3 Populate pull/push time properties to the returning data when listing tags
Populate pull/push time properties to the returning data when listing tags

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-08-07 11:47:05 +08:00
Wenkai Yin(尹文开)
556e07f0c4
Merge pull request #8551 from nlowe/feat/retention/GH-8548-Pulled-in-the-last-N-Days
Retention: New Evaluator: Pulled within the last N Days
2019-08-07 11:37:46 +08:00
Qian Deng
635066da92
Merge pull request #8466 from reasonerjt/remove-clair-notification
Remove clair notifier
2019-08-07 10:53:35 +08:00
Nathan Lowe
9a7df265ce
Retention: New Evaluator: Pulled within the last N Days
Signed-off-by: Nathan Lowe <public@nlowe.me>
2019-08-06 22:28:28 -04:00
Wenkai Yin(尹文开)
ec4fa753d7
Merge pull request #8552 from nlowe/feat/retention/GH-8549-Pushed-in-the-last-N-Days
Retention: New Evaluator: Retain Images pushed within N days
2019-08-07 09:55:05 +08:00
ethan
edd102c3b7
core/main.go: logging message correction
Signed-off-by: ethan <guangming.wang@daocloud.io>
2019-08-06 21:56:18 +08:00
Ziming Zhang
498a813299 retain nothing rule
Change-Id: I4e7a4ecb40fe39b80e41a6d9bf8b5fb3968a41af
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2019-08-06 15:10:27 +08:00
Nathan Lowe
756352d271
Add metadata for daysps to the API for the UI
Signed-off-by: Nathan Lowe <public@nlowe.me>
2019-08-05 20:08:34 -04:00