akuity / kargo

Application lifecycle orchestration
https://kargo.akuity.io/
Apache License 2.0
1.67k stars 141 forks source link

OCI repository with Chart and Image : warehouse display both (no matter if it's an chart or image warehouse) #2831

Open flbla opened 1 week ago

flbla commented 1 week ago

Checklist

Description

I have an OCI repository with Charts and Images in it. When I create a warehouse (image or chart) it display charts AND images versions.

Screenshots

image

image

image

Steps to Reproduce

An OCI repo with charts and images in it. Create a chart warehouse connected to this repo. => Images version are also displayed

Version

/ $ kargo version
{
  "Version": "v1.0.1",
  "BuildDate": "2024-10-22T00:33:07Z",
  "GitCommit": "9fc3e3b417de09d4fd561ceeb1d87cece989bd4a",
  "GitTreeDirty": false,
  "GoVersion": "go1.23.2",
  "Compiler": "gc",
  "Platform": "linux/amd64"
}
hiddeco commented 1 week ago

I suspect you are subscribed to images using something like a tag selector. When Kargo selects images using such a selector, it relies solely on the tag list provided by the registry API, which is a simple list containing strings. Because of this, it has no idea about the image type (which would require at least one additional request per listed tag).

While I see us benefiting from an image type selector complementary to the existing platform selector at some point, I would not see us enabling this by default, as it changes the complexity from O(1) to O(n).

Until we have such a feature, I can see a couple of ways for you to work around this problem for container images:

  1. Use an allowTags regex expression, as I can see a pattern of v1.0.0. versus 1.0.0.
  2. Not putting all your eggs in the same basket, i.e. have separate image repositories for Helm charts versus images.

For the Helm chart discovery part, the quick fix would be for us to ignore anything that isn't a strict SemVer (which is how helm itself determines what is and isn't a chart): https://github.com/helm/helm/blob/v3.16.1/pkg/registry/client.go#L682-L690

I will draft a pull request to enforce this.