fix client wait problem

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
pull/5964/head
Lyndon-Li 2023-03-08 09:25:43 +08:00
parent 8bed159023
commit 28d636bd71
3 changed files with 5 additions and 2 deletions

View File

@ -0,0 +1 @@
Fix client wait problem after async operation change, velero backup/restore --wait should check a full list of the terminal status

View File

@ -277,7 +277,8 @@ func (o *CreateOptions) Run(c *cobra.Command, f client.Factory) error {
return nil
}
if backup.Status.Phase != velerov1api.BackupPhaseNew && backup.Status.Phase != velerov1api.BackupPhaseInProgress {
if backup.Status.Phase == velerov1api.BackupPhaseFailedValidation || backup.Status.Phase == velerov1api.BackupPhaseCompleted ||
backup.Status.Phase == velerov1api.BackupPhasePartiallyFailed || backup.Status.Phase == velerov1api.BackupPhaseFailed {
fmt.Printf("\nBackup completed with status: %s. You may check for more information using the commands `velero backup describe %s` and `velero backup logs %s`.\n", backup.Status.Phase, backup.Name, backup.Name)
return nil
}

View File

@ -355,7 +355,8 @@ func (o *CreateOptions) Run(c *cobra.Command, f client.Factory) error {
return nil
}
if restore.Status.Phase != api.RestorePhaseNew && restore.Status.Phase != api.RestorePhaseInProgress {
if restore.Status.Phase == api.RestorePhaseFailedValidation || restore.Status.Phase == api.RestorePhaseCompleted ||
restore.Status.Phase == api.RestorePhasePartiallyFailed || restore.Status.Phase == api.RestorePhaseFailed {
fmt.Printf("\nRestore completed with status: %s. You may check for more information using the commands `velero restore describe %s` and `velero restore logs %s`.\n", restore.Status.Phase, restore.Name, restore.Name)
return nil
}