Repository navigation
Closed
Labels
bugCategorizes issue or PR as related to a bug.
Description
What happened?
I tried many different references with unexpected results:
For reference, the tag in the registry is 1.4.2, and digest is sha256:aef46c66a7f2d5a12a7e3f54a64790daf5c9a9e66af3f46955efdaa6c900341d. A tag v1.4.2 does NOT exist.
# tag only
$ helm4 upgrade --install nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress:1.4.2
# works
# tag with "v"
$ helm4 upgrade --install nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress:v1.4.2
Error: failed to perform "FetchReference" on source: ghcr.io/nginxinc/charts/nginx-ingress:v1.4.2: not found
# digest only
$ helm4 upgrade --install nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress@sha256:aef46c66a7f2d5a12a7e3f54a64790daf5c9a9e66af3f46955efdaa6c900341d
# works
# tag without "v" and digest
$ helm4 upgrade --install nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress:1.4.2@sha256:aef46c66a7f2d5a12a7e3f54a64790daf5c9a9e66af3f46955efdaa6c900341d
Error: encoding/hex: invalid byte: U+0073 's'
# tag with "v" and digest
$ helm4 upgrade --install nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress:v1.4.2@sha256:aef46c66a7f2d5a12a7e3f54a64790daf5c9a9e66af3f46955efdaa6c900341d
# works
# tag + wrong digest
$ helm4 upgrade --install nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress:1.4.2@sha256:aef46c66a7f2d5a12a7e3f54a64790daf5c9a9e66af3f46955efdaa6c9003xxx
Error: invalid reference: invalid digest "sha256:aef46c66a7f2d5a12a7e3f54a64790daf5c9a9e66af3f46955efdaa6c9003xxx": invalid checksum digest format
# unexpected, but very nice
# Wrong tag + digest
$ helm4 upgrade --install nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress:v1.4.2xxx@sha256:aef46c66a7f2d5a12a7e3f54a64790daf5c9a9e66af3f46955efdaa6c900341d
# worksWhat did you expect to happen?
More consistency:
- tag+digest should work. Why does it only work with an invalid tag?
- if specifying a wrong digest gets validated, the reverse should also be true. If the tag points to a different digest this should cause an error
- actually, most client usually ignore the tag entirely if a digest is present. But as-is the helm4 implementation is inconsistent.
How can we reproduce it (as minimally and precisely as possible)?
See my sample commands above.
Helm version
Details
$ helm4 version
version.BuildInfo{Version:"v4.0.1", GitCommit:"12500dd401faa7629f30ba5d5bff36287f3e94d3", GitTreeState:"clean", GoVersion:"go1.25.4", KubeClientVersion:"v1.34"}```
</details>
### Kubernetes version
<details>
```console
$ kubectl version
Client Version: v1.34.1
Kustomize Version: v5.7.1
Server Version: v1.34.0```
</details>Reacted by Nick Berthold and Richard Wall
Metadata
Metadata
Assignees
Labels
bugCategorizes issue or PR as related to a bug.
Activity
banjoh commentedon Dec 3, 2025
I'm able to reproduce this inconsistency
banjoh commentedon Dec 3, 2025
I created https://github.com/helm/helm/pull/31601/files PR which addresses
Here is the test
As for a successfull pull when the tag is wrong (
v1.4.2@sha256:aef46c6...), the digest is given preference. This seems to be an intentional behaviourbanjoh commentedon Dec 3, 2025
You can test the build of #31601 PR to see if it works as you would want.
maboehm commentedon Dec 3, 2025
Thanks for looking into it so quickly!
Ah, I looked at my error output more closely again - (
invalid checksum digest format). This is expected, asxis not a hex character. So the better test cases are:So I guess this is the same way most clients behave - when both are present the tag is simply ignored.
maboehm commentedon Dec 3, 2025
I checked out your change and ran
Sucessfully, so I guess your PR resolves this.
banjoh commentedon Dec 3, 2025
Awesome!
Work around helm v4 oci bug
Work around helm v4 oci bug
Work around helm v4 oci bug