Skip to content

Commit

Permalink
[imagemanager] Allow downgrade for cached service instances
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Lohvynenko <[email protected]>
  • Loading branch information
mlohvynenko authored and al1img committed Oct 8, 2024
1 parent e55059c commit fd27dad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion imagemanager/imagemanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,13 @@ func (imagemanager *Imagemanager) InstallService(serviceInfo cloudprotocol.Servi
}

if version.LessThanOrEqual(versionInStorage) {
return ErrVersionMismatch
// Workaround for the case when the service is cached and the version is downgraded.
// Should be refactored once CM is capable to check if unit is in validation set.
if !serviceFromStorage.Cached {
return ErrVersionMismatch
}

log.WithField("serviceID", serviceInfo.ServiceID).Warn("Service is cached, allow version downgrade")
}
}

Expand Down

0 comments on commit fd27dad

Please sign in to comment.