Skip to content

Commit

Permalink
fix: use HelmRelease max history for rollback remediation
Browse files Browse the repository at this point in the history
Signed-off-by: Stevo Slavic <[email protected]>
  • Loading branch information
sslavic committed Feb 11, 2025
1 parent 8dfcca2 commit dda1d35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/action/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions internal/action/rollback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit dda1d35

Please sign in to comment.