Unverified Commit aeaf3a12 authored by danfengliu's avatar danfengliu Committed by GitHub
Browse files

Merge pull request #9387 from danfengliu/Fix-prepary-for-upgrade-pipeline

Fix a 'if' position error in project metadata population
parents 0076f231 848002df
......@@ -61,26 +61,16 @@ class HarborAPI:
def update_project_setting(self, project, public, contenttrust, preventrunning, preventseverity, scanonpush):
r = request(url+"projects?name="+project+"", 'get')
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 = {
"metadata": {
"public": public,
"enable_content_trust": contenttrust,
"prevent_vul": preventrunning,
"severity": preventseverity,
"auto_scan": scanonpush
}
payload = {
"metadata": {
"public": public,
"enable_content_trust": contenttrust,
"prevent_vul": preventrunning,
"severity": preventseverity,
"auto_scan": scanonpush
}
}
body=dict(body=payload)
request(url+"projects/"+projectid+"", 'put', **body)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment