Merge pull request #1169 from sslavic/stevo-rollback-remed-max-hist

fix: use HelmRelease max history for rollback remediation
This commit is contained in:
Stefan Prodan 2025-02-11 16:52:33 +02:00 committed by GitHub
commit 15d0dc8252
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -65,6 +65,7 @@ func newRollback(config *helmaction.Configuration, obj *v2.HelmRelease, opts []R
rollback.Force = obj.GetRollback().Force
rollback.Recreate = obj.GetRollback().Recreate
rollback.CleanupOnFail = obj.GetRollback().CleanupOnFail
rollback.MaxHistory = obj.GetMaxHistory()
for _, opt := range opts {
opt(rollback)

View File

@ -49,6 +49,7 @@ func Test_newRollback(t *testing.T) {
g.Expect(got).ToNot(BeNil())
g.Expect(got.Timeout).To(Equal(obj.Spec.Rollback.Timeout.Duration))
g.Expect(got.Force).To(Equal(obj.Spec.Rollback.Force))
g.Expect(got.MaxHistory).To(Equal(obj.GetMaxHistory()))
})
t.Run("rollback to version", func(t *testing.T) {