goharbor / harbor

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

Better handling for Flux Artifact #20921

Open jonesbusy opened 2 weeks ago

jonesbusy commented 2 weeks ago

Hi,

This is an idea for Flux artifacts

We are using Harbor to store Flux OCI artifacts. When checking on the UI it's not clear it's Flux Artifact because they fall under the default type

flux_manifest

According to https://fluxcd.io/flux/cheatsheets/oci-artifacts/

Flux OCI Artifact set the following types

artifact media type application/vnd.oci.image.manifest.v1+json
config media type application/vnd.cncf.flux.config.v1+json
content media type application/vnd.cncf.flux.content.v1.tar+gzip

Maybe just adding a Flux logo would be enough ? for those media types ?

reasonerjt commented 1 week ago

For Harbor to support new types of Artifacts there are two options: 1) Update Harbor's code to add a new processor to support new artifact 2) The OCI artifact can be bundled in a certain way that is recognizable by Harbor, see this proposal

Can we proceed with option 2)?

jonesbusy commented 1 week ago

Thanks for your answer. I was not aware of this proposal

Checking at a flux manifest

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "config": {
    "mediaType": "application/vnd.cncf.flux.config.v1+json",
    "size": 233,
    "digest": "sha256:59cb5a5df1278e0e4149b68bb0c57d920c2e6efe6fe65e0e1988293269a6cb9c"
  },
  "layers": [
    {
      "mediaType": "application/vnd.cncf.flux.content.v1.tar+gzip",
      "size": 337,
      "digest": "sha256:540013791074130f25c437ff9a40881c1a72fe94b6c89840b788f58dc36936e5"
    }
  ],
  "annotations": {
    "org.opencontainers.image.created": "2024-09-19T02:00:06Z",
    "org.opencontainers.image.revision": "staging@sha1:5192698a9835579e136ab2b656f49e83d113c36d  services.json",
    "org.opencontainers.image.source": "****"
  }
}

So if we go with 2) it means the flux client must send this png layer ?

I understand for propriatary artifact, but I would argue that 1) is also a solution since Flux is also a CNCF graduated like Helm