harborctl
harborctl copied to clipboard
[NOTE] The parameters of API "POST /projects/{project_id}/metadatas" alters dramatically.
related:
- https://github.com/moooofly/harbor-go-client/issues/23
by swagger file for harbor API v1.6.0, the content body is
{
"public": "true",
"enable_content_trust": "true",
"prevent_vul": "true",
"severity": "low",
"auto_scan": "true"
}
by swagger file for harbor API v1.4.0, the content body is
{
"public": 1,
"enable_content_trust": true,
"prevent_vulnerable_images_from_running": true,
"prevent_vulnerable_images_from_running_severity": "low",
"automatically_scan_images_on_push": true
}
issues
- Can add only one key/value pair each time calling this API, or you will get "400 invalid request: has no valid key/value pairs or has more than one valid key/value pairs" as above.
- Add the same metadata again, you will get "409 Conflict"
- After adding a metadata, if delete it, can not add it again (tigger 500 error).
get first
delete it
get again
add this metadata again by API "POST /projects/{project_id}/metadatas"