Skip to content

Commit f05a783

Browse files
committed
Check upgrade details state before allowing a manual rollback
1 parent 1a376f1 commit f05a783

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/pkg/agent/application/coordinator/coordinator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ func (c *Coordinator) Upgrade(ctx context.Context, version string, sourceURI str
748748
var err error
749749
for i := 0; i < 5; i++ {
750750
s := c.State()
751-
// if we are not already upgrading or if the incoming is a rollback request we can continue processing
752-
if s.State != agentclient.Upgrading || uOpts.rollback {
751+
// if we are not already upgrading or if the incoming is a rollback request while the watcher is running, we can continue processing
752+
if s.State != agentclient.Upgrading || (uOpts.rollback && s.UpgradeDetails != nil && s.UpgradeDetails.State == details.StateWatching) {
753753
err = nil
754754
break
755755
}

0 commit comments

Comments
 (0)