mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
fix(pkg/storage): If storage.Create fails to clean up recent release versions, return an error
Previously, storage.Create was ignoring the error. This meant that a user that relied on the recent release version cleanup would not be notified if that cleanup failed, and release versions could grow without bound. Closes #9145 Signed-off-by: Daniel Lipovetsky <dlipovetsky@d2iq.com>
This commit is contained in:
parent
8c28da6567
commit
00cf10d360
1 changed files with 4 additions and 1 deletions
|
|
@ -61,7 +61,10 @@ func (s *Storage) Create(rls *rspb.Release) error {
|
|||
s.Log("creating release %q", makeKey(rls.Name, rls.Version))
|
||||
if s.MaxHistory > 0 {
|
||||
// Want to make space for one more release.
|
||||
s.removeLeastRecent(rls.Name, s.MaxHistory-1)
|
||||
if err := s.removeLeastRecent(rls.Name, s.MaxHistory-1); err != nil &&
|
||||
!errors.Is(err, driver.ErrReleaseNotFound) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return s.Driver.Create(makeKey(rls.Name, rls.Version), rls)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue