Visitar URL original
OCI: partial version like `--version 1.2` is fetched as a literal tag instead of resolved as a range · Issue #32866 · helm/helm · GitHub
Skip to content

OCI: partial version like --version 1.2 is fetched as a literal tag instead of resolved as a range #32866

Open

Description

@ChadiDridi

With an OCI chart, a partial version like 1.2 or 1 is used as a literal tag instead of being resolved against the registry's tags. For HTTP repos the same value is treated as a range.

Registry has mychart 1.2.0 and 1.2.5:

$ helm pull oci://<reg>/mychart --version 1.2
Error: failed to perform "FetchReference" on source: <reg>/mychart:1.2: not found

--version ~1.2 pulls 1.2.5. A dependency with version: "1.2" and an oci:// repository fails the same way in helm dependency update, while the same dependency from an HTTP repo resolves to 1.2.x.

Cause: ValidateReference (pkg/registry/client.go:882) and the resolver (internal/resolver/resolver.go:139) use semver.NewVersion to decide whether the version is explicit. It accepts 1.2 and 1, so the value is used verbatim as the tag.

Charts pushed with a non-strict version (tag 1.2) rely on the exact tag today, so a fix should probably try the exact tag first, or use StrictNewVersion for the explicit check.

Helm version: main (c540ca0)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions