|
|
@ -28,6 +28,7 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
"helm.sh/helm/v3/internal/fileutil"
|
|
|
|
"helm.sh/helm/v3/internal/fileutil"
|
|
|
|
"helm.sh/helm/v3/internal/urlutil"
|
|
|
|
"helm.sh/helm/v3/internal/urlutil"
|
|
|
|
|
|
|
|
"helm.sh/helm/v3/pkg/cache"
|
|
|
|
"helm.sh/helm/v3/pkg/getter"
|
|
|
|
"helm.sh/helm/v3/pkg/getter"
|
|
|
|
"helm.sh/helm/v3/pkg/helmpath"
|
|
|
|
"helm.sh/helm/v3/pkg/helmpath"
|
|
|
|
"helm.sh/helm/v3/pkg/provenance"
|
|
|
|
"helm.sh/helm/v3/pkg/provenance"
|
|
|
@ -73,6 +74,8 @@ type ChartDownloader struct {
|
|
|
|
RegistryClient *registry.Client
|
|
|
|
RegistryClient *registry.Client
|
|
|
|
RepositoryConfig string
|
|
|
|
RepositoryConfig string
|
|
|
|
RepositoryCache string
|
|
|
|
RepositoryCache string
|
|
|
|
|
|
|
|
// IndexFileCache holds parsed IndexFiles as YAML parsing big files is a very slow operation
|
|
|
|
|
|
|
|
IndexFileCache *cache.Cache[*repo.IndexFile]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DownloadTo retrieves a chart. Depending on the settings, it may also download a provenance file.
|
|
|
|
// DownloadTo retrieves a chart. Depending on the settings, it may also download a provenance file.
|
|
|
@ -279,7 +282,7 @@ func (c *ChartDownloader) ResolveChartVersion(ref, version string) (*url.URL, er
|
|
|
|
|
|
|
|
|
|
|
|
// Next, we need to load the index, and actually look up the chart.
|
|
|
|
// Next, we need to load the index, and actually look up the chart.
|
|
|
|
idxFile := filepath.Join(c.RepositoryCache, helmpath.CacheIndexFile(r.Config.Name))
|
|
|
|
idxFile := filepath.Join(c.RepositoryCache, helmpath.CacheIndexFile(r.Config.Name))
|
|
|
|
i, err := repo.LoadIndexFile(idxFile)
|
|
|
|
i, err := repo.LoadIndexFileWithCache(idxFile, c.IndexFileCache)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return u, errors.Wrap(err, "no cached repo found. (try 'helm repo update')")
|
|
|
|
return u, errors.Wrap(err, "no cached repo found. (try 'helm repo update')")
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -378,7 +381,7 @@ func (c *ChartDownloader) scanReposForURL(u string, rf *repo.File) (*repo.Entry,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
idxFile := filepath.Join(c.RepositoryCache, helmpath.CacheIndexFile(r.Config.Name))
|
|
|
|
idxFile := filepath.Join(c.RepositoryCache, helmpath.CacheIndexFile(r.Config.Name))
|
|
|
|
i, err := repo.LoadIndexFile(idxFile)
|
|
|
|
i, err := repo.LoadIndexFileWithCache(idxFile, c.IndexFileCache)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, errors.Wrap(err, "no cached repo found. (try 'helm repo update')")
|
|
|
|
return nil, errors.Wrap(err, "no cached repo found. (try 'helm repo update')")
|
|
|
|
}
|
|
|
|
}
|
|
|
|