mirror of
https://github.com/helm/helm.git
synced 2026-08-04 15:10:47 +00: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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user