artifacthub / hub

Find, install and publish Cloud Native packages
https://artifacthub.io
Apache License 2.0
1.68k stars 229 forks source link

ArtifactHub should take the OCI Artifacts Kind into account when adding Repositories #3068

Closed Vad1mo closed 1 year ago

Vad1mo commented 1 year ago

Is your feature request related to a problem? Please describe.

I created a repository in ArtifactHub for a Helm Chart in the OCI format (ID:da341298-9576-477a-b4aa-65d8b9ca0b27).

The Url of that repository is oci://8gears.container-registry.com/library/helm-charts-oci-proxy

helm pull oci://8gears.container-registry.com/library/helm-charts-oci-proxy --version 1.0.0`

At the same time, I have a container image with that same name in the same registry.

docker pull 8gears.container-registry.com/library/helm-charts-oci-proxy:latest

While this is totally fine and a valid use inside the registry and all the respective tools like Helm and Docker/Podman it doesn't work in ArtifactHub.

When trying to add the repository, the error message There is another repository using this url tells me that oci://8gears.container-registry.com/library/helm-charts-oci-proxy is already used in the context of a Helm Chart.

image

Describe the solution you'd like

It would make sense that when creating repositories, the uniqueness of the URL would take the repository kind into account. More and more artifacts will have the same URLs for different kinds of artifacts in the future.

Describe alternatives you've considered Push the artifact under a different name is the only workaround.

Additional context

tegioz commented 1 year ago

Hi @Vad1mo 👋

Thanks for raising this issue.

Although I understand in some cases this restriction may feel a bit inconvenient, lifting it could be problematic. One example would be repositories kinds that rely on the generic tracker, which are the majority. In those cases, different kinds of repositories share the same structure and use the same metadata files, and what makes them different for AH is the repository kind selected. But if we allowed reusing the same url when used on a different kind, it'd be possible to add an existing KEDA scalers repository as a Keptn integrations one, for example. If misused, this could create a lot of problems and confusion for users.

TBH I wouldn't expect this to be a common problem among different repository kinds, with the exception of OCI artifacts, which are already used by some kinds like Helm charts or Kubewarden policies (probably more will follow).

However, I'm not really sure if it'd be a good idea to publish the same repository (or artifact) as two different kinds. IMHO this could be confusing for users when searching for packages. In the search results, they could see first the helm-charts-oci-proxy container image entry, and not be sure of what to do with it, whereas the Helm chart entry, that is more specific and self-descriptive, will provide installation instructions plus a lot of information about the chart that the OCI entry wouldn't display.

Hope this makes sense 🙂

tegioz commented 1 year ago

Will close this one for now, please feel free to reopen if needed 🙂

abdennour commented 9 months ago

it's not make-sense restriction. please fix it /repoen