fix: implement ps:restore

Also add all the niceties around parallelism that were introduced for the other commands.
This commit is contained in:
Jose Diaz-Gonzalez committed 2020-11-21 20:57:33 -05:00
1 parent 8ae597ad1d
commit ab0cc6c444
3 files changed
+67 -3

No files matched your search

+23 -2
View File
@@ -83,8 +83,29 @@ func CommandRestart(appName string, allApps bool, parallelCount int) error {
// CommandRestore starts previously running apps e.g. after reboot
// TODO: implement me
func CommandRestore(appName string) error {
return nil
func CommandRestore(appName string, allApps bool, parallelCount int) error {
if allApps {
if err := RestorePrep(); err != nil {
return err
}
return common.RunCommandAgainstAllApps(Restore, "restore", parallelCount)
}
if appName == "" {
common.LogWarn("Restore specified without app, assuming --all")
if err := RestorePrep(); err != nil {
return err
}
return common.RunCommandAgainstAllApps(Restore, "restore", parallelCount)
}
if err := common.VerifyAppName(appName); err != nil {
return err
}
return Restore(appName)
}
// CommandRetire ensures old containers are retired