|
|
|
@ -86,6 +86,8 @@ type ChartDownloader struct {
|
|
|
|
|
// Returns a string path to the location where the file was downloaded and a verification
|
|
|
|
|
// (if provenance was verified), or an error if something bad happened.
|
|
|
|
|
func (c *ChartDownloader) DownloadTo(ref, version, dest string) (string, *provenance.Verification, error) {
|
|
|
|
|
var out strings.Builder
|
|
|
|
|
|
|
|
|
|
u, err := c.ResolveChartVersion(ref, version)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return "", nil, err
|
|
|
|
@ -109,6 +111,7 @@ func (c *ChartDownloader) DownloadTo(ref, version, dest string) (string, *proven
|
|
|
|
|
|
|
|
|
|
destfile := filepath.Join(dest, name)
|
|
|
|
|
if err := fileutil.AtomicWriteFile(destfile, data, 0644); err != nil {
|
|
|
|
|
fmt.Fprintf(&out, "Chart downloaded to: %s\n", destfile)
|
|
|
|
|
return destfile, nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|