mirror of
https://github.com/helm/helm.git
synced 2026-08-04 15:10:47 +00:00
Update chart_downloader.go
Signed-off-by: Jeff van Dam <66410239+JvD-Ericsson@users.noreply.github.com>
This commit is contained in:
committed by
Jeff van Dam
parent
1689248274
commit
e5fdaa1c65
@@ -27,6 +27,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"helm.sh/helm/v3/internal/fileutil"
|
||||
"helm.sh/helm/v3/internal/urlutil"
|
||||
"helm.sh/helm/v3/pkg/getter"
|
||||
"helm.sh/helm/v3/pkg/helmpath"
|
||||
"helm.sh/helm/v3/pkg/provenance"
|
||||
@@ -377,13 +378,19 @@ func (c *ChartDownloader) scanReposForURL(u string, rf *repo.File) (*repo.Entry,
|
||||
}
|
||||
|
||||
idxFile := filepath.Join(c.RepositoryCache, helmpath.CacheIndexFile(r.Config.Name))
|
||||
yamlFile, err := os.ReadFile(idxFile)
|
||||
i, err := repo.LoadIndexFile(idxFile)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "no cached repo found. (try 'helm repo update')")
|
||||
}
|
||||
file := string(yamlFile[:])
|
||||
if strings.Contains(file, u) {
|
||||
return rc, nil
|
||||
|
||||
for _, entry := range i.Entries {
|
||||
for _, ver := range entry {
|
||||
for _, dl := range ver.URLs {
|
||||
if urlutil.Equal(u, dl) {
|
||||
return rc, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// This means that there is no repo file for the given URL.
|
||||
|
||||
Reference in New Issue
Block a user