carvel-dev / vendir

Easy way to vendor portions of git repos, github releases, helm charts, docker image contents, etc. declaratively
https://carvel.dev/vendir
Apache License 2.0
268 stars 46 forks source link

Syncing OCI helm chart with semver version range fails if tag has a v prefix #358

Closed reegnz closed 4 months ago

reegnz commented 4 months ago

What steps did you take: [A clear and concise description steps that can be used to reproduce the problem.]

I tried syncing a helm OCI chart from here: https://github.com/metacontroller/metacontroller/pkgs/container/metacontroller-helm/153598243?tag=v4.11.7

The chart version is published with a v prefix (which is quite common).

I used the following vendir.yml

---
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- path: vendor
  contents:
  - path: metacontroller
    helmChart:
      name: metacontroller/metacontroller-helm
      version: ^4.0
      repository:
        url: oci://ghcr.io

What happened:

❯ vendir sync
Fetching: vendor + metacontroller (helm chart from oci://ghcr.io@metacontroller/metacontroller-helm:^4.0)

vendir: Error: Syncing directory 'vendor':
  Syncing directory 'metacontroller' with helm chart contents:
    Helm chart pull: exit status 1 (stderr: Error: Unable to locate any tags in provided repository: oci://ghcr.io/metacontroller/metacontroller-helm

If I change the version to 4.11.7 the sync also fails. Only case when the sync works is if I explicitly declare the tag with a v prefix like v4.11.7 but then semver rules don't work eg. v4.0.

What did you expect: I expected the vendir command to resolve the latest version to 4.11.7, sync that, and write that version into the lock file.

Anything else you would like to add:

Environment:


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

reegnz commented 4 months ago

OTOH this might be a helm issue, so I'll also throw the topic into the project's github.

reegnz commented 4 months ago

Opened an issue with the chart maintainer: https://github.com/metacontroller/metacontroller/issues/946