Skip to content

Commit ace5304

Browse files
committed
make watcher rollback only if the agent has not been already rolled back
1 parent 76428d1 commit ace5304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/pkg/agent/cmd/watch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func watchCmd(log *logp.Logger, topDir string, cfg *configuration.UpgradeWatcher
120120
_ = locker.Unlock()
121121
}()
122122

123-
if marker.DesiredOutcome == upgrade.OUTCOME_ROLLBACK {
123+
if marker.DesiredOutcome == upgrade.OUTCOME_ROLLBACK && marker.Details.State != details.StateRollback {
124124
// TODO: there should be some sanity check in rollback functions like the installation we are going back to should exist and work
125125
log.Infof("rolling back because of DesiredOutcome=%s", marker.DesiredOutcome.String())
126126
err = installModifier.Rollback(context.Background(), log, client.New(), paths.Top(), marker.PrevVersionedHome, marker.PrevHash)

0 commit comments

Comments
 (0)