Skip to content

Commit b04519a

Browse files
committed
feat(mongodbflex): add async output handling in restore and clone commands
1 parent 1f89580 commit b04519a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

internal/cmd/mongodbflex/backup/restore/restore.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
108108
s.Stop()
109109
}
110110

111-
params.Printer.Outputf("Restored instance %q with backup %q\n", model.InstanceId, model.BackupId)
111+
operationState := "Restored"
112+
if model.Async {
113+
operationState = "Triggered restore of"
114+
}
115+
params.Printer.Outputf("%s instance %q with backup %q\n", operationState, model.InstanceId, model.BackupId)
112116
return nil
113117
}
114118

@@ -129,7 +133,11 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
129133
s.Stop()
130134
}
131135

132-
params.Printer.Outputf("Cloned instance %q from backup with timestamp %q\n", model.InstanceId, model.Timestamp)
136+
operationState := "Cloned"
137+
if model.Async {
138+
operationState = "Triggered clone of"
139+
}
140+
params.Printer.Outputf("%s instance %q from backup with timestamp %q\n", operationState, model.InstanceId, model.Timestamp)
133141
return nil
134142
},
135143
}

0 commit comments

Comments
 (0)