When users run `helm pull` without a version, OCI pulls already print
“Pulled:” and “Digest:”. HTTP/repo pulls do not. Some providers (e.g.
Bitnami) resolve --repo pulls to `oci://` but skip the registry client
summary, so nothing is printed.
- Now we print a summary for `--repo` and direct HTTP pulls after
download.
- Keep direct oci:// behavior unchanged (avoid duplicate output).
- Mirror OCI format:
```
Pulled: <chart>:<version>
Digest: sha256:<digest>
```
For HTTP/repo, the digest is the archive SHA-256 (.tgz).
For OCI, the digest is the manifest digest (unchanged).
I tested with command like:
```sh
helm pull ingress-nginx --repo=https://kubernetes.github.io/ingress-nginx --version 4.10.1
helm pull oci://registry-1.docker.io/bitnamicharts/nginx --version '20.0.7'
helm/bin/helm pull redis --repo=https://charts.bitnami.com/bitnami --version='22.0.4'
```
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
* Runtime abstraction to encapsulate subprocess code and enable future runtimes
Also fix race condition in TestPrepareCommandExtraArgs by replacing the shared variable modification with a local copy
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
* Remove commented out code
Co-authored-by: Joe Julian <me@joejulian.name>
Signed-off-by: Scott Rigby <scott@r6by.com>
* Check test failure string
Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
---------
Signed-off-by: Scott Rigby <scott@r6by.com>
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Co-authored-by: Joe Julian <me@joejulian.name>
Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
A few things are added here:
1. The cache is made to be more generic as a content based cache.
It could be used for other things such as plugins
2. Flags were added to specify the content cache locaiton rather
than rely on the repository cache. Keeping the 2 the same
hid bugs and errors.
3. Tests were added and updated to ensure the cache is used and
tested
Signed-off-by: Matt Farina <matt.farina@suse.com>
The previous cache was based on chart name and version. If 2 charts
with different content had the same name and version they would collide.
Helm did not trust the cache because of this and always downloaded
content. It was a short lived cache.
This commit introduces a content based cache which is based on the
content rather than file name. Charts with the same name but different
content are no longer an issue.
While the system assumes a file based interface, the cache system
is pluggable. In the future, it should return bytes for the content
instead of paths to it. That would requie a larger change for Helm 5
or later.
Signed-off-by: Matt Farina <matt.farina@suse.com>