Skip to content

Commit 80cc9a6

Browse files
fix(upgrade): always check for upgrade when enabled via configuration
relates to #6775
1 parent 910a20f commit 80cc9a6

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/cli/upgrade.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ var upgradeCmd = &cobra.Command{
6363

6464
cache.Init(sh, cache.Persist)
6565

66+
if _, OK := cache.Get[string](cache.Device, upgrade.CACHEKEY); OK {
67+
log.Debug("upgrade check already performed recently, skipping")
68+
return
69+
}
70+
6671
terminal.Init(sh)
6772
fmt.Print(terminal.StartProgress())
6873

@@ -72,7 +77,7 @@ var upgradeCmd = &cobra.Command{
7277
fmt.Print(terminal.StopProgress())
7378

7479
// always reset the cache key so we respect the interval no matter what the outcome
75-
cache.Set(cache.Device, upgrade.CACHEKEY, "", cfg.Upgrade.Interval)
80+
cache.Set(cache.Device, upgrade.CACHEKEY, "true", cfg.Upgrade.Interval)
7681

7782
cache.Close()
7883

src/config/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,6 @@ func (cfg *Config) Features(env runtime.Environment) shell.Features {
198198
func (cfg *Config) upgradeFeatures() shell.Features {
199199
var feats shell.Features
200200

201-
if _, OK := cache.Get[string](cache.Device, upgrade.CACHEKEY); OK && !cfg.Upgrade.Force {
202-
log.Debug("upgrade cache key found and not forced, skipping upgrade")
203-
return feats
204-
}
205-
206201
autoUpgrade := cfg.Upgrade.Auto
207202
if val, OK := cache.Get[bool](cache.Device, AUTOUPGRADE); OK {
208203
log.Debug("auto upgrade key found, overriding config")

0 commit comments

Comments
 (0)