Skip to content

Commit bf15a0e

Browse files
committed
Fixed invalid FAIL about finished upgrade plans
1 parent b00fc04 commit bf15a0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

service/upgrade_manager.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ type UpgradePlan struct {
126126
ToVersion driver.Version `json:"to_version"`
127127
}
128128

129+
// IsEmpty returns true when the given plan has not been initialized.
130+
func (p UpgradePlan) IsEmpty() bool {
131+
return p.CreatedAt.IsZero()
132+
}
133+
129134
// IsReady returns true when all entries have finished.
130135
func (p UpgradePlan) IsReady() bool {
131136
return len(p.Entries) == 0
@@ -780,7 +785,7 @@ func (m *upgradeManager) RunWatchUpgradePlan(ctx context.Context) {
780785
}
781786
}
782787
plan, err := m.readUpgradePlan(ctx)
783-
if agency.IsKeyNotFound(err) {
788+
if agency.IsKeyNotFound(err) || plan.IsEmpty() {
784789
// Just try later
785790
} else if err != nil {
786791
// Failed to read plan

0 commit comments

Comments
 (0)