Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Improve rolled back condition check
Browse files Browse the repository at this point in the history
Before this change the actual rollback status was not consulted in
case the status of the chart fetch was successful, which could lead
to the wrong state being reported back.
  • Loading branch information
hiddeco committed Jun 17, 2019
1 parent e3993e5 commit 469ef18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion integrations/helm/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ func HasRolledBack(hr v1beta1.HelmRelease) bool {
// each other, on which we both want to act, we _must_ compare
// the update timestamps as the transition timestamp will only
// change on a status shift.
return !(chartFetched.Status == v1.ConditionTrue && rolledBack.LastUpdateTime.Before(&chartFetched.LastUpdateTime))
if chartFetched.Status == v1.ConditionTrue && rolledBack.LastUpdateTime.Before(&chartFetched.LastUpdateTime) {
return false
}
}

return rolledBack.Status == v1.ConditionTrue
Expand Down

0 comments on commit 469ef18

Please sign in to comment.