Skip to content

Commit

Permalink
Merge pull request #177 from nxtcoder17/fix/premature-index-file-down…
Browse files Browse the repository at this point in the history
…load

fix(client.go): fixes premature index file download
  • Loading branch information
elenz97 authored Jul 26, 2023
2 parents 8d0453a + dc68a0b commit 15ee7e0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,18 @@ func (c *HelmClient) AddOrUpdateChartRepo(entry repo.Entry) error {

chartRepo.CachePath = c.Settings.RepositoryCache

if c.storage.Has(entry.Name) {
c.DebugLog("WARNING: repository name %q already exists", entry.Name)
return nil
}

if !registry.IsOCI(entry.URL) {
_, err = chartRepo.DownloadIndexFile()
if err != nil {
return err
}
}

if c.storage.Has(entry.Name) {
c.DebugLog("WARNING: repository name %q already exists", entry.Name)
return nil
}

c.storage.Update(&entry)
err = c.storage.WriteFile(c.Settings.RepositoryConfig, 0o644)
if err != nil {
Expand Down

0 comments on commit 15ee7e0

Please sign in to comment.