From 0fd1f27062e39b20ab9ede576196bad9dc6e8378 Mon Sep 17 00:00:00 2001 From: JenTing Hsiao Date: Wed, 14 Aug 2024 20:16:56 +0800 Subject: [PATCH 1/2] fix: cache helm-index in Redis cluster Signed-off-by: JenTing Hsiao --- reposerver/repository/repository.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go index d530f1a6e0c15..f2a56a5a600fb 100644 --- a/reposerver/repository/repository.go +++ b/reposerver/repository/repository.go @@ -2508,7 +2508,7 @@ func checkoutRevision(gitClient git.Client, revision string, submoduleEnabled bo } func (s *Service) GetHelmCharts(ctx context.Context, q *apiclient.HelmChartsRequest) (*apiclient.HelmChartsResponse, error) { - index, err := s.newHelmClient(q.Repo.Repo, q.Repo.GetHelmCreds(), q.Repo.EnableOCI, q.Repo.Proxy, helm.WithChartPaths(s.chartPaths)).GetIndex(true, s.initConstants.HelmRegistryMaxIndexSize) + index, err := s.newHelmClient(q.Repo.Repo, q.Repo.GetHelmCreds(), q.Repo.EnableOCI, q.Repo.Proxy, helm.WithIndexCache(s.cache), helm.WithChartPaths(s.chartPaths)).GetIndex(true, s.initConstants.HelmRegistryMaxIndexSize) if err != nil { return nil, err } From d11e1c5e364ed3c5407fe98efd00a96dfc86e6a7 Mon Sep 17 00:00:00 2001 From: Dan Garfield Date: Wed, 21 Aug 2024 09:11:14 -0600 Subject: [PATCH 2/2] Update repository.go Fix order Signed-off-by: Dan Garfield --- reposerver/repository/repository.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go index 51cfc0cf9cf5e..80e89c29edce9 100644 --- a/reposerver/repository/repository.go +++ b/reposerver/repository/repository.go @@ -2508,7 +2508,7 @@ func checkoutRevision(gitClient git.Client, revision string, submoduleEnabled bo } func (s *Service) GetHelmCharts(ctx context.Context, q *apiclient.HelmChartsRequest) (*apiclient.HelmChartsResponse, error) { - index, err := s.newHelmClient(q.Repo.Repo, q.Repo.GetHelmCreds(), q.Repo.EnableOCI, q.Repo.Proxy, helm.WithIndexCache(s.cache), q.Repo.NoProxy, helm.WithChartPaths(s.chartPaths)).GetIndex(true, s.initConstants.HelmRegistryMaxIndexSize) + index, err := s.newHelmClient(q.Repo.Repo, q.Repo.GetHelmCreds(), q.Repo.EnableOCI, q.Repo.Proxy, q.Repo.NoProxy, helm.WithIndexCache(s.cache), helm.WithChartPaths(s.chartPaths)).GetIndex(true, s.initConstants.HelmRegistryMaxIndexSize) if err != nil { return nil, err }