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 <hello@hidde.co>
This commit is contained in:
Hidde Beydals 2022-01-13 10:50:16 +01:00
parent d2eec330aa
commit 8aad5520b6
1 changed files with 1 additions and 1 deletions

View File

@ -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())