From 022041993007d13da2c71158cc330fffddbddf5f Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Mon, 21 Oct 2019 17:31:08 -0700 Subject: [PATCH] --wip-- [skip ci] --- pkg/getter/getter.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/getter/getter.go b/pkg/getter/getter.go index e11dbfcae..b545c1e1f 100644 --- a/pkg/getter/getter.go +++ b/pkg/getter/getter.go @@ -35,6 +35,7 @@ type options struct { username string password string userAgent string + cachePath string } // Option allows specifying various settings configurable by the user for overriding the defaults @@ -73,6 +74,14 @@ func WithTLSClientConfig(certFile, keyFile, caFile string) Option { } } +// WithCache will wrap all HTTP requests through the local file system cache. +// Charts are cached in a flat structure with name equal to the chart digest. +func WithCache(digest string) Option { + return func(opts *options) { + opts.cachePath = path.Join(helmpath.ChartCachePath(), digest) // new? + } +} + // Getter is an interface to support GET to the specified URL. type Getter interface { // Get file content by url string