only allow chart upgrades with greater version (#2224)

This commit is contained in:
Adrian Stobbe 2023-08-14 15:08:25 +02:00 committed by GitHub
parent b12f2867dd
commit 58e9906811
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,11 +154,11 @@ func (c *UpgradeClient) Upgrade(ctx context.Context, config *config.Config, idFi
newReleases = append(newReleases, release) newReleases = append(newReleases, release)
case errors.As(err, &invalidUpgrade): case errors.As(err, &invalidUpgrade):
c.log.Debugf("Appending to %s upgrade: %s", release.ReleaseName, err) c.log.Debugf("Appending to %s upgrade: %s", release.ReleaseName, err)
upgradeReleases = append(upgradeReleases, release) upgradeErrs = append(upgradeErrs, fmt.Errorf("skipping %s upgrade: %w", release.ReleaseName, err))
case err != nil: case err != nil:
c.log.Debugf("Adding %s to upgrade releases...", release.ReleaseName)
return fmt.Errorf("should upgrade %s: %w", release.ReleaseName, err) return fmt.Errorf("should upgrade %s: %w", release.ReleaseName, err)
case err == nil: case err == nil:
c.log.Debugf("Adding %s to upgrade releases...", release.ReleaseName)
upgradeReleases = append(upgradeReleases, release) upgradeReleases = append(upgradeReleases, release)
// Check if installing/upgrading the chart could be destructive // Check if installing/upgrading the chart could be destructive