From 3ae2f48d029646df7aa6bef0169b78286dd2ff45 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Thu, 28 Aug 2025 01:01:40 +0200 Subject: [PATCH 1/8] pull: log resolved version and digest for repo/non-OCI pulls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: : Digest: sha256: ``` 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 --- pkg/action/pull.go | 32 ++++++++++ pkg/action/pull_test.go | 129 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+) create mode 100644 pkg/action/pull_test.go diff --git a/pkg/action/pull.go b/pkg/action/pull.go index c1f77e44c..5eaa0bf1a 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -17,6 +17,7 @@ limitations under the License. package action import ( + "crypto/sha256" "fmt" "os" "path/filepath" @@ -138,6 +139,37 @@ func (p *Pull) Run(chartRef string) (string, error) { return out.String(), err } + // Print a pull summary for repo mode and non-OCI downloads. + // Some repos (e.g., Bitnami) resolve --repo pulls to oci:// refs, but that + // path does not go through the registry client's summary printer, so we emit + // a consistent summary here. We mirror the OCI output format: + // + // Pulled: : + // Digest: sha256: + // + // For HTTP/repo pulls, the digest is the SHA-256 of the downloaded .tgz archive. + // For direct OCI pulls, the registry client already prints "Pulled:" and + // "Digest:" (manifest digest), so we do not print here to avoid duplicates. + if p.RepoURL != "" || !registry.IsOCI(downloadSourceRef) { + base := strings.TrimSuffix(filepath.Base(saved), ".tgz") + chart := base + ver := "" + if i := strings.LastIndex(base, "-"); i > 0 { + chart = base[:i] + ver = base[i+1:] + } + if ver != "" { + fmt.Fprintf(&out, "Pulled: %s:%s\n", chart, ver) + } else { + fmt.Fprintf(&out, "Pulled: %s\n", chart) + } + + if f, err := os.ReadFile(saved); err == nil { + sum := sha256.Sum256(f) + fmt.Fprintf(&out, "Digest: sha256:%x\n", sum) + } + } + if p.Verify { for name := range v.SignedBy.Identities { fmt.Fprintf(&out, "Signed by: %v\n", name) diff --git a/pkg/action/pull_test.go b/pkg/action/pull_test.go new file mode 100644 index 000000000..69af3c2fc --- /dev/null +++ b/pkg/action/pull_test.go @@ -0,0 +1,129 @@ +/* +Copyright The Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package action + +import ( + "crypto/sha256" + "fmt" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "helm.sh/helm/v4/pkg/cli" +) + +// helm pull testchart --repo=http://127.0.0.1: --version 1.2.3 +func TestPull_PrintsSummary_ForHTTPRepo(t *testing.T) { + t.Parallel() + + // Minimal chart payload; verification is off so a plain byte buffer is fine. + chartBytes := []byte("dummy-chart-content") + sum := sha256.Sum256(chartBytes) + wantDigest := fmt.Sprintf("sha256:%x", sum) + + // Serve a valid index.yaml and the chart archive. + mux := http.NewServeMux() + mux.HandleFunc("/index.yaml", func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "text/yaml") + // Valid index entry requires both name and version. + fmt.Fprintf(w, `apiVersion: v1 +entries: + testchart: + - name: testchart + version: 1.2.3 + urls: + - testchart-1.2.3.tgz + created: "2020-01-01T00:00:00Z" +`) + }) + mux.HandleFunc("/testchart-1.2.3.tgz", func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/gzip") + _, _ = w.Write(chartBytes) + }) + srv := httptest.NewServer(mux) + defer srv.Close() + + // Isolate Helm env/cache to temp dirs for deterministic tests. + settings := cli.New() + settings.RepositoryCache = t.TempDir() + settings.RepositoryConfig = filepath.Join(t.TempDir(), "repositories.yaml") + settings.ContentCache = t.TempDir() + + cfg := &Configuration{} // minimal config; no K8s or registry for HTTP path + + p := NewPull(WithConfig(cfg)) + p.Settings = settings + p.DestDir = t.TempDir() + p.RepoURL = srv.URL + p.Version = "1.2.3" + + out, err := p.Run("testchart") + require.NoError(t, err, "Pull.Run() should succeed. Output:\n%s", out) + + assert.Contains(t, out, "Pulled: testchart:1.2.3", "expected Pulled summary in output") + assert.Contains(t, out, "Digest: "+wantDigest, "expected archive digest in output") + + // Ensure the chart file was saved. + _, statErr := os.Stat(filepath.Join(p.DestDir, "testchart-1.2.3.tgz")) + require.NoError(t, statErr, "expected chart archive to be saved") +} + +// helm pull http://127.0.0.1:/directchart-9.9.9.tgz +func TestPull_PrintsSummary_ForDirectHTTPURL(t *testing.T) { + t.Parallel() + + chartBytes := []byte("another-dummy-chart") + sum := sha256.Sum256(chartBytes) + wantDigest := fmt.Sprintf("sha256:%x", sum) + + mux := http.NewServeMux() + mux.HandleFunc("/directchart-9.9.9.tgz", func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/gzip") + _, _ = w.Write(chartBytes) + }) + srv := httptest.NewServer(mux) + defer srv.Close() + + settings := cli.New() + settings.RepositoryCache = t.TempDir() + settings.RepositoryConfig = filepath.Join(t.TempDir(), "repositories.yaml") + settings.ContentCache = t.TempDir() + + cfg := &Configuration{} + + p := NewPull(WithConfig(cfg)) + p.Settings = settings + p.DestDir = t.TempDir() + + // Direct HTTP URL (absolute URL). Version is ignored for absolute URLs. + chartURL := srv.URL + "/directchart-9.9.9.tgz" + + out, err := p.Run(chartURL) + require.NoError(t, err, "Pull.Run() should succeed. Output:\n%s", out) + + // Output should reflect name-version.tgz from the URL. + assert.Contains(t, out, "Pulled: directchart:9.9.9", "expected Pulled summary in output") + assert.Contains(t, out, "Digest: "+wantDigest, "expected archive digest in output") + + // Ensure the chart file was saved. + _, statErr := os.Stat(filepath.Join(p.DestDir, "directchart-9.9.9.tgz")) + require.NoError(t, statErr, "expected chart archive to be saved") +} From 4d3b3456a8727494ffdc7a4c82c4801bd8f9d5a2 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Thu, 28 Aug 2025 01:30:02 +0200 Subject: [PATCH 2/8] Properly match new output in pull cmd tests Signed-off-by: Benoit Tigeot --- pkg/action/pull_test.go | 3 +-- pkg/cmd/pull_test.go | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/action/pull_test.go b/pkg/action/pull_test.go index 69af3c2fc..f7cd45885 100644 --- a/pkg/action/pull_test.go +++ b/pkg/action/pull_test.go @@ -61,13 +61,12 @@ entries: srv := httptest.NewServer(mux) defer srv.Close() - // Isolate Helm env/cache to temp dirs for deterministic tests. settings := cli.New() settings.RepositoryCache = t.TempDir() settings.RepositoryConfig = filepath.Join(t.TempDir(), "repositories.yaml") settings.ContentCache = t.TempDir() - cfg := &Configuration{} // minimal config; no K8s or registry for HTTP path + cfg := &Configuration{} p := NewPull(WithConfig(cfg)) p.Settings = settings diff --git a/pkg/cmd/pull_test.go b/pkg/cmd/pull_test.go index c3156c394..8a7a223cd 100644 --- a/pkg/cmd/pull_test.go +++ b/pkg/cmd/pull_test.go @@ -44,7 +44,9 @@ func TestPullCmd(t *testing.T) { t.Fatal(err) } - helmTestKeyOut := "Signed by: Helm Testing (This key should only be used for testing. DO NOT TRUST.) \n" + + helmTestKeyOut := "Pulled: signtest:0.1.0\n" + + "Digest: sha256:e5ef611620fb97704d8751c16bab17fedb68883bfb0edc76f78a70e9173f9b55\n" + + "Signed by: Helm Testing (This key should only be used for testing. DO NOT TRUST.) \n" + "Using Key With Fingerprint: 5E615389B53CA37F0EE60BD3843BBF981FC18762\n" + "Chart Hash Verified: " From 43ab1525a2e40dda1d1fa97d9496faa1ff2e862c Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Fri, 29 Aug 2025 10:21:30 +0200 Subject: [PATCH 3/8] Print full url instead of chart name and version Signed-off-by: Benoit Tigeot --- pkg/action/pull.go | 13 +------------ pkg/action/pull_test.go | 6 ++++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/pkg/action/pull.go b/pkg/action/pull.go index 5eaa0bf1a..dc1e33e3a 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -151,18 +151,7 @@ func (p *Pull) Run(chartRef string) (string, error) { // For direct OCI pulls, the registry client already prints "Pulled:" and // "Digest:" (manifest digest), so we do not print here to avoid duplicates. if p.RepoURL != "" || !registry.IsOCI(downloadSourceRef) { - base := strings.TrimSuffix(filepath.Base(saved), ".tgz") - chart := base - ver := "" - if i := strings.LastIndex(base, "-"); i > 0 { - chart = base[:i] - ver = base[i+1:] - } - if ver != "" { - fmt.Fprintf(&out, "Pulled: %s:%s\n", chart, ver) - } else { - fmt.Fprintf(&out, "Pulled: %s\n", chart) - } + fmt.Fprintf(&out, "Pulled: %s\n", downloadSourceRef) if f, err := os.ReadFile(saved); err == nil { sum := sha256.Sum256(f) diff --git a/pkg/action/pull_test.go b/pkg/action/pull_test.go index f7cd45885..7d06ff9dd 100644 --- a/pkg/action/pull_test.go +++ b/pkg/action/pull_test.go @@ -77,7 +77,8 @@ entries: out, err := p.Run("testchart") require.NoError(t, err, "Pull.Run() should succeed. Output:\n%s", out) - assert.Contains(t, out, "Pulled: testchart:1.2.3", "expected Pulled summary in output") + expectedURL := srv.URL + "/testchart-1.2.3.tgz" + assert.Contains(t, out, "Pulled: "+expectedURL, "expected Pulled summary in output") assert.Contains(t, out, "Digest: "+wantDigest, "expected archive digest in output") // Ensure the chart file was saved. @@ -119,7 +120,8 @@ func TestPull_PrintsSummary_ForDirectHTTPURL(t *testing.T) { require.NoError(t, err, "Pull.Run() should succeed. Output:\n%s", out) // Output should reflect name-version.tgz from the URL. - assert.Contains(t, out, "Pulled: directchart:9.9.9", "expected Pulled summary in output") + expectedURL := srv.URL + "/directchart-9.9.9.tgz" + assert.Contains(t, out, "Pulled: "+expectedURL, "expected Pulled summary in output") assert.Contains(t, out, "Digest: "+wantDigest, "expected archive digest in output") // Ensure the chart file was saved. From e9cfefbf44117741718d9b62d62cfd0ec90a699f Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Fri, 29 Aug 2025 16:34:29 +0200 Subject: [PATCH 4/8] Output should be closer to the one for OCI registry Plus handling of p.Version if we are not able to extract the version... not sure is what we want.. Plus handling of tar.gz Plus a little refactoring Signed-off-by: Benoit Tigeot --- pkg/action/pull.go | 47 +++++++++++++++++++++++++++++++++++++---- pkg/action/pull_test.go | 10 ++++----- pkg/cmd/pull_test.go | 2 +- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/pkg/action/pull.go b/pkg/action/pull.go index dc1e33e3a..8619e50e4 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -19,6 +19,7 @@ package action import ( "crypto/sha256" "fmt" + "io" "os" "path/filepath" "strings" @@ -144,17 +145,25 @@ func (p *Pull) Run(chartRef string) (string, error) { // path does not go through the registry client's summary printer, so we emit // a consistent summary here. We mirror the OCI output format: // - // Pulled: : + // Pulled: : // Digest: sha256: // // For HTTP/repo pulls, the digest is the SHA-256 of the downloaded .tgz archive. // For direct OCI pulls, the registry client already prints "Pulled:" and // "Digest:" (manifest digest), so we do not print here to avoid duplicates. if p.RepoURL != "" || !registry.IsOCI(downloadSourceRef) { - fmt.Fprintf(&out, "Pulled: %s\n", downloadSourceRef) + base := trimAnySuffix(downloadSourceRef, ".tar.gz", ".tgz") + chart, ver := splitChartNameVersion(base) + + tag := chart + if ver != "" { + tag += ":" + ver + } else if p.Version != "" { + tag += ":" + p.Version + } + fmt.Fprintf(&out, "Pulled: %s\n", tag) - if f, err := os.ReadFile(saved); err == nil { - sum := sha256.Sum256(f) + if sum, err := sha256File(saved); err == nil { fmt.Fprintf(&out, "Digest: sha256:%x\n", sum) } } @@ -194,3 +203,33 @@ func (p *Pull) Run(chartRef string) (string, error) { } return out.String(), nil } + +func trimAnySuffix(s string, suffixes ...string) string { + for _, suf := range suffixes { + if strings.HasSuffix(s, suf) { + return strings.TrimSuffix(s, suf) + } + } + return s +} + +func splitChartNameVersion(s string) (name, version string) { + if i := strings.LastIndex(s, "-"); i > 0 { + return s[:i], s[i+1:] + } + return s, "" +} + +func sha256File(path string) ([]byte, error) { + f, err := os.Open(path) + if err != nil { + return nil, err + } + defer f.Close() + + h := sha256.New() + if _, err := io.Copy(h, f); err != nil { + return nil, err + } + return h.Sum(nil), nil +} diff --git a/pkg/action/pull_test.go b/pkg/action/pull_test.go index 7d06ff9dd..5c6f488e9 100644 --- a/pkg/action/pull_test.go +++ b/pkg/action/pull_test.go @@ -77,7 +77,7 @@ entries: out, err := p.Run("testchart") require.NoError(t, err, "Pull.Run() should succeed. Output:\n%s", out) - expectedURL := srv.URL + "/testchart-1.2.3.tgz" + expectedURL := srv.URL + "/testchart:1.2.3" assert.Contains(t, out, "Pulled: "+expectedURL, "expected Pulled summary in output") assert.Contains(t, out, "Digest: "+wantDigest, "expected archive digest in output") @@ -95,7 +95,7 @@ func TestPull_PrintsSummary_ForDirectHTTPURL(t *testing.T) { wantDigest := fmt.Sprintf("sha256:%x", sum) mux := http.NewServeMux() - mux.HandleFunc("/directchart-9.9.9.tgz", func(w http.ResponseWriter, _ *http.Request) { + mux.HandleFunc("/directchart-9.9.9.tar.gz", func(w http.ResponseWriter, _ *http.Request) { w.Header().Set("Content-Type", "application/gzip") _, _ = w.Write(chartBytes) }) @@ -114,17 +114,17 @@ func TestPull_PrintsSummary_ForDirectHTTPURL(t *testing.T) { p.DestDir = t.TempDir() // Direct HTTP URL (absolute URL). Version is ignored for absolute URLs. - chartURL := srv.URL + "/directchart-9.9.9.tgz" + chartURL := srv.URL + "/directchart-9.9.9.tar.gz" out, err := p.Run(chartURL) require.NoError(t, err, "Pull.Run() should succeed. Output:\n%s", out) // Output should reflect name-version.tgz from the URL. - expectedURL := srv.URL + "/directchart-9.9.9.tgz" + expectedURL := srv.URL + "/directchart:9.9.9" assert.Contains(t, out, "Pulled: "+expectedURL, "expected Pulled summary in output") assert.Contains(t, out, "Digest: "+wantDigest, "expected archive digest in output") // Ensure the chart file was saved. - _, statErr := os.Stat(filepath.Join(p.DestDir, "directchart-9.9.9.tgz")) + _, statErr := os.Stat(filepath.Join(p.DestDir, "directchart-9.9.9.tar.gz")) require.NoError(t, statErr, "expected chart archive to be saved") } diff --git a/pkg/cmd/pull_test.go b/pkg/cmd/pull_test.go index 8a7a223cd..34bf2860b 100644 --- a/pkg/cmd/pull_test.go +++ b/pkg/cmd/pull_test.go @@ -44,7 +44,7 @@ func TestPullCmd(t *testing.T) { t.Fatal(err) } - helmTestKeyOut := "Pulled: signtest:0.1.0\n" + + helmTestKeyOut := "Pulled: test/signtest\n" + "Digest: sha256:e5ef611620fb97704d8751c16bab17fedb68883bfb0edc76f78a70e9173f9b55\n" + "Signed by: Helm Testing (This key should only be used for testing. DO NOT TRUST.) \n" + "Using Key With Fingerprint: 5E615389B53CA37F0EE60BD3843BBF981FC18762\n" + From 311659c085faf37f8e80dc43e49c336c54630cc2 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Mon, 1 Sep 2025 10:36:54 +0200 Subject: [PATCH 5/8] Deal with potential chart name with that start with hyphen From copilot review: > The condition i > 0 will fail to split chart names that start with a hyphen followed by a version (e.g., "-chart-1.0.0" would return "-chart-1.0.0", "" instead of "-chart", "1.0.0"). This should be i >= 0 to handle edge cases correctly. https://github.com/helm/helm/pull/31206#discussion_r2311950405 Signed-off-by: Benoit Tigeot --- pkg/action/pull.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/action/pull.go b/pkg/action/pull.go index 8619e50e4..eadbc4c00 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -214,7 +214,7 @@ func trimAnySuffix(s string, suffixes ...string) string { } func splitChartNameVersion(s string) (name, version string) { - if i := strings.LastIndex(s, "-"); i > 0 { + if i := strings.LastIndex(s, "-"); i >= 0 { return s[:i], s[i+1:] } return s, "" From df391c0324861b59317a5c610ab9687354efae9a Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Sat, 6 Sep 2025 22:37:53 +0200 Subject: [PATCH 6/8] Inform when we are no able to provide digest Signed-off-by: Benoit Tigeot --- pkg/action/pull.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/action/pull.go b/pkg/action/pull.go index eadbc4c00..0365d9215 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -165,6 +165,8 @@ func (p *Pull) Run(chartRef string) (string, error) { if sum, err := sha256File(saved); err == nil { fmt.Fprintf(&out, "Digest: sha256:%x\n", sum) + } else { + fmt.Fprintf(&out, "Digest failed: %v\n", err) } } From 5b0dc8f021859ed9bf32837e9f1db94c10f827e1 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Sat, 6 Sep 2025 22:41:54 +0200 Subject: [PATCH 7/8] Focus on tgz https://github.com/helm/helm/pull/31206#discussion_r2328036710 Signed-off-by: Benoit Tigeot --- pkg/action/pull.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/action/pull.go b/pkg/action/pull.go index 0365d9215..01855bc59 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -152,7 +152,7 @@ func (p *Pull) Run(chartRef string) (string, error) { // For direct OCI pulls, the registry client already prints "Pulled:" and // "Digest:" (manifest digest), so we do not print here to avoid duplicates. if p.RepoURL != "" || !registry.IsOCI(downloadSourceRef) { - base := trimAnySuffix(downloadSourceRef, ".tar.gz", ".tgz") + base := strings.TrimSuffix(downloadSourceRef, ".tgz") chart, ver := splitChartNameVersion(base) tag := chart @@ -206,15 +206,6 @@ func (p *Pull) Run(chartRef string) (string, error) { return out.String(), nil } -func trimAnySuffix(s string, suffixes ...string) string { - for _, suf := range suffixes { - if strings.HasSuffix(s, suf) { - return strings.TrimSuffix(s, suf) - } - } - return s -} - func splitChartNameVersion(s string) (name, version string) { if i := strings.LastIndex(s, "-"); i >= 0 { return s[:i], s[i+1:] From 83789b112b43828e17bfbf6a9a1c964278a54f77 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Wed, 24 Sep 2025 22:43:40 +0200 Subject: [PATCH 8/8] Avoid misleading terminology when displaying SHA-256 checksum For HTTP/repo-based chart pulls, we calculate the SHA-256 checksum of the downloaded .tgz archive file, not a manifest digest. This change updates the output terminology to be more accurate: - HTTP pulls: "Checksum: sha256:..." (file checksum) - OCI pulls: "Digest: ..." (manifest digest, unchanged) Signed-off-by: Benoit Tigeot --- pkg/action/pull.go | 6 +++--- pkg/action/pull_test.go | 4 ++-- pkg/cmd/pull_test.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/action/pull.go b/pkg/action/pull.go index 01855bc59..75f30eeda 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -146,7 +146,7 @@ func (p *Pull) Run(chartRef string) (string, error) { // a consistent summary here. We mirror the OCI output format: // // Pulled: : - // Digest: sha256: + // Checksum: sha256: // // For HTTP/repo pulls, the digest is the SHA-256 of the downloaded .tgz archive. // For direct OCI pulls, the registry client already prints "Pulled:" and @@ -164,9 +164,9 @@ func (p *Pull) Run(chartRef string) (string, error) { fmt.Fprintf(&out, "Pulled: %s\n", tag) if sum, err := sha256File(saved); err == nil { - fmt.Fprintf(&out, "Digest: sha256:%x\n", sum) + fmt.Fprintf(&out, "Checksum: sha256:%x\n", sum) } else { - fmt.Fprintf(&out, "Digest failed: %v\n", err) + fmt.Fprintf(&out, "Checksum failed: %v\n", err) } } diff --git a/pkg/action/pull_test.go b/pkg/action/pull_test.go index 5c6f488e9..49068466c 100644 --- a/pkg/action/pull_test.go +++ b/pkg/action/pull_test.go @@ -79,7 +79,7 @@ entries: expectedURL := srv.URL + "/testchart:1.2.3" assert.Contains(t, out, "Pulled: "+expectedURL, "expected Pulled summary in output") - assert.Contains(t, out, "Digest: "+wantDigest, "expected archive digest in output") + assert.Contains(t, out, "Checksum: "+wantDigest, "expected archive checksum in output") // Ensure the chart file was saved. _, statErr := os.Stat(filepath.Join(p.DestDir, "testchart-1.2.3.tgz")) @@ -122,7 +122,7 @@ func TestPull_PrintsSummary_ForDirectHTTPURL(t *testing.T) { // Output should reflect name-version.tgz from the URL. expectedURL := srv.URL + "/directchart:9.9.9" assert.Contains(t, out, "Pulled: "+expectedURL, "expected Pulled summary in output") - assert.Contains(t, out, "Digest: "+wantDigest, "expected archive digest in output") + assert.Contains(t, out, "Checksum: "+wantDigest, "expected archive checksum in output") // Ensure the chart file was saved. _, statErr := os.Stat(filepath.Join(p.DestDir, "directchart-9.9.9.tar.gz")) diff --git a/pkg/cmd/pull_test.go b/pkg/cmd/pull_test.go index 34bf2860b..0629f2127 100644 --- a/pkg/cmd/pull_test.go +++ b/pkg/cmd/pull_test.go @@ -45,7 +45,7 @@ func TestPullCmd(t *testing.T) { } helmTestKeyOut := "Pulled: test/signtest\n" + - "Digest: sha256:e5ef611620fb97704d8751c16bab17fedb68883bfb0edc76f78a70e9173f9b55\n" + + "Checksum: sha256:e5ef611620fb97704d8751c16bab17fedb68883bfb0edc76f78a70e9173f9b55\n" + "Signed by: Helm Testing (This key should only be used for testing. DO NOT TRUST.) \n" + "Using Key With Fingerprint: 5E615389B53CA37F0EE60BD3843BBF981FC18762\n" + "Chart Hash Verified: "