mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-18 13:41:21 +01:00
Fix an error in prepary.py in Jenkins upgrade pipeline, which is a 'if' position error in project metadata population.
Signed-off-by: Danfeng Liu (c) <danfengl@vmware.com>
This commit is contained in:
parent
7d0505593f
commit
848002df83
@ -61,17 +61,6 @@ class HarborAPI:
|
|||||||
def update_project_setting(self, project, public, contenttrust, preventrunning, preventseverity, scanonpush):
|
def update_project_setting(self, project, public, contenttrust, preventrunning, preventseverity, scanonpush):
|
||||||
r = request(url+"projects?name="+project+"", 'get')
|
r = request(url+"projects?name="+project+"", 'get')
|
||||||
projectid = str(r.json()[0]['project_id'])
|
projectid = str(r.json()[0]['project_id'])
|
||||||
if args.version == "1.6":
|
|
||||||
payload = {
|
|
||||||
"metadata": {
|
|
||||||
"public": public,
|
|
||||||
"enable_content_trust": contenttrust,
|
|
||||||
"prevent_vulnerable_images_from_running": preventrunning,
|
|
||||||
"prevent_vulnerable_images_from_running_severity": preventseverity,
|
|
||||||
"automatically_scan_images_on_push": scanonpush
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
payload = {
|
payload = {
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"public": public,
|
"public": public,
|
||||||
@ -81,6 +70,7 @@ class HarborAPI:
|
|||||||
"auto_scan": scanonpush
|
"auto_scan": scanonpush
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
body=dict(body=payload)
|
body=dict(body=payload)
|
||||||
request(url+"projects/"+projectid+"", 'put', **body)
|
request(url+"projects/"+projectid+"", 'put', **body)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user