Skip to content

Commit

Permalink
fix(auto_update): use correct argument order
Browse files Browse the repository at this point in the history
  • Loading branch information
sweigert committed Feb 7, 2024
1 parent efa4c25 commit 7e697db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions supervisor/autoupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ func (s *Supervisor) update() error {
return err
}

log := logrus.WithFields(logrus.Fields{
"current": currentVersion,
"latest": m.Version,
})

manifestVersion, err := m.parseVersion()
if err != nil {
return fmt.Errorf("failed to parse manifest Version: %s: %+v", m.Version, err)
}

if compareSemver(manifestVersion, currentVersion) < 1 {
log := logrus.WithFields(logrus.Fields{
"current": currentVersion,
"latest": manifestVersion,
})

if compareSemver(currentVersion, manifestVersion) < 1 {
// version greater or equal; nothing to do
log.Info("current version greater or equal; nothing to do")
return nil
Expand Down
2 changes: 1 addition & 1 deletion supervisor/semver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestSupervisor_compareSemver(t *testing.T) {
res = compareSemver([]int{1, 0, 0}, []int{1, 1, 0})
assert.Equal(t, 1, res)

res = compareSemver([]int{1, 0, 0}, []int{1, 0, 1})
res = compareSemver([]int{1, 0, 0}, []int{1, 0, 2})
assert.Equal(t, 1, res)

res = compareSemver([]int{1, 0, 0}, []int{1, 1, 1})
Expand Down

0 comments on commit 7e697db

Please sign in to comment.