Skip to content

Commit

Permalink
fix: do not send upgrade check requests if the current version is a dev
Browse files Browse the repository at this point in the history
version

This will prevent the upgrade responder from having too many tags which
can be a performance issue

Signed-off-by: Phan Le <[email protected]>
  • Loading branch information
PhanLe1010 committed Sep 25, 2024
1 parent 3ac6b93 commit a9d117f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion controller/setting_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (

"github.com/longhorn/longhorn-manager/constant"
"github.com/longhorn/longhorn-manager/datastore"
"github.com/longhorn/longhorn-manager/meta"
"github.com/longhorn/longhorn-manager/types"
"github.com/longhorn/longhorn-manager/util"

Expand Down Expand Up @@ -1326,6 +1327,8 @@ func (sc *SettingController) syncUpgradeChecker() error {
return err
}

isDevVersion := strings.Contains(meta.Version, "dev")

latestLonghornVersion, err := sc.ds.GetSetting(types.SettingNameLatestLonghornVersion)
if err != nil {
return err
Expand All @@ -1335,7 +1338,7 @@ func (sc *SettingController) syncUpgradeChecker() error {
return err
}

if !upgradeCheckerEnabled {
if !upgradeCheckerEnabled || isDevVersion {
if latestLonghornVersion.Value != "" {
latestLonghornVersion.Value = ""
if _, err := sc.ds.UpdateSetting(latestLonghornVersion); err != nil {
Expand Down

0 comments on commit a9d117f

Please sign in to comment.