Skip to content

Commit

Permalink
fix: repo cache race condition (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis authored Sep 30, 2024
1 parent c68724a commit 3bfac4a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/build/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ func (h *Helm) buildFromHelmRepository(ctx context.Context, obj *sourcev1beta2.H
chartRepo = r.(repository.Downloader)
}

defer h.repoCache.SetUnlock(repoCacheKey, nil)
defer h.repoCache.SetUnlock(repoCacheKey, chartRepo)

if chartRepo == nil {
h.Logger.V(1).Info("using chart repo", "chartrepo", normalizedURL)
Expand Down Expand Up @@ -605,8 +605,6 @@ func (h *Helm) buildFromHelmRepository(ctx context.Context, obj *sourcev1beta2.H

chartRepo = httpChartRepo
}

h.repoCache.SetUnlock(repoCacheKey, chartRepo)
}

// Construct the chart builder with scoped configuration
Expand Down

0 comments on commit 3bfac4a

Please sign in to comment.