Skip to content

Commit 1f936ce

Browse files
committed
Update upgrade details metadata Equals() with new fields
1 parent 2822486 commit 1f936ce

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

internal/pkg/agent/application/upgrade/details/details.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package details
66

77
import (
88
"math"
9+
"slices"
910
"sync"
1011
"time"
1112

@@ -244,7 +245,9 @@ func (m Metadata) Equals(otherM Metadata) bool {
244245
m.DownloadPercent == otherM.DownloadPercent &&
245246
m.DownloadRate == otherM.DownloadRate &&
246247
equalTimePointers(m.RetryUntil, otherM.RetryUntil) &&
247-
m.RetryErrorMsg == otherM.RetryErrorMsg
248+
m.RetryErrorMsg == otherM.RetryErrorMsg &&
249+
m.Reason == otherM.Reason &&
250+
slices.Equal(m.RollbacksAvailable, otherM.RollbacksAvailable)
248251
}
249252

250253
func equalTimePointers(t, otherT *time.Time) bool {

internal/pkg/agent/application/upgrade/marker_watcher_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ details:
126126
expectedDetails: &details.Details{
127127
TargetVersion: "8.9.2",
128128
State: details.StateRollback,
129+
Metadata: details.Metadata{
130+
Reason: details.ReasonWatchFailed,
131+
},
129132
},
130133
},
131134
"same_version_with_details_some_state": {

0 commit comments

Comments
 (0)