From 8aad5520b6bacc7a97d7aaea9f46aa6a6a965a36 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Thu, 13 Jan 2022 10:50:16 +0100 Subject: [PATCH] helm: remove temp file name from index cache err Due to the temporary file having a random suffix, it would result in the notification-controller not rate limiting the messages as they are "unique". For the close error (which also makes use of the name), we keep the information as it might be of importance to figure out why the close failed. Signed-off-by: Hidde Beydals --- internal/helm/repository/chart_repository.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/helm/repository/chart_repository.go b/internal/helm/repository/chart_repository.go index 8cee2e02..fd355c0e 100644 --- a/internal/helm/repository/chart_repository.go +++ b/internal/helm/repository/chart_repository.go @@ -269,7 +269,7 @@ func (r *ChartRepository) CacheIndex() (string, error) { if err = r.DownloadIndex(mw); err != nil { f.Close() os.RemoveAll(f.Name()) - return "", fmt.Errorf("failed to cache index to '%s': %w", f.Name(), err) + return "", fmt.Errorf("failed to cache index to temporary file: %w", err) } if err = f.Close(); err != nil { os.RemoveAll(f.Name())