harborctl icon indicating copy to clipboard operation
harborctl copied to clipboard

[NOTE] The parameters of API "POST /projects/{project_id}/metadatas" alters dramatically.

Open moooofly opened this issue 5 years ago • 0 comments

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

image

image

  • 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.

image

image

  • Add the same metadata again, you will get "409 Conflict"

image

  • After adding a metadata, if delete it, can not add it again (tigger 500 error).

get first

image

image

delete it

image

image

get again

image

add this metadata again by API "POST /projects/{project_id}/metadatas"

image

moooofly avatar Nov 02 '18 14:11 moooofly