goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.93k stars 4.74k forks source link

Is there a way to list all oci helm repositories across projects? #18089

Open vijaySamanuri opened 1 year ago

vijaySamanuri commented 1 year ago

currently the only way i could figure out:

  1. list all projects
  2. iterate through each project and list repositories
  3. and then iterate through each repostiory and list artifacts to find out if it is oci helm repository. harbor api GET /api/v2.0/projects//repositories//artifacts) media_type and manifest_media_type fields in each artifact object distinguishes between helm chart and container image

is there a better way to list all oci helm repositories using harbor APIs?

AllForNothing commented 1 year ago

Unfortunately, there is no better way by using Harbor APIs. Maybe, you can write a script to automate these steps

qnetter commented 1 year ago

The question assumes there is a thing called an "OCI Helm repository." If my understanding is correct, there are OCI repos. An OCI repo can contain multiple types of OCI objects. So what would make a repo an OCI Helm repo"? One that has any Helm charts? One that has only Helm charts? I think enumeration by chart is the only way possible. Anything else would replicate basic logic.