mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-05 13:05:17 +00:00
update CLI outputs for PartiallyFailed phase
Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
@@ -50,7 +50,10 @@ func NewLogsCommand(f client.Factory) *cobra.Command {
|
||||
cmd.Exit("Error checking for restore %q: %v", restoreName, err)
|
||||
}
|
||||
|
||||
if restore.Status.Phase != v1.RestorePhaseCompleted && restore.Status.Phase != v1.RestorePhaseFailed {
|
||||
switch restore.Status.Phase {
|
||||
case v1.RestorePhaseCompleted, v1.RestorePhaseFailed, v1.RestorePhasePartiallyFailed:
|
||||
// terminal phases, don't exit.
|
||||
default:
|
||||
cmd.Exit("Logs for restore %q are not available until it's finished processing. Please wait "+
|
||||
"until the restore has a phase of Completed or Failed and try again.", restoreName)
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package output
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
@@ -35,7 +36,17 @@ func DescribeRestore(restore *v1.Restore, podVolumeRestores []v1.PodVolumeRestor
|
||||
d.DescribeMetadata(restore.ObjectMeta)
|
||||
|
||||
d.Println()
|
||||
d.Printf("Phase:\t%s\n", restore.Status.Phase)
|
||||
phase := restore.Status.Phase
|
||||
if phase == "" {
|
||||
phase = v1.RestorePhaseNew
|
||||
}
|
||||
|
||||
resultsNote := ""
|
||||
if phase == v1.RestorePhaseFailed || phase == v1.RestorePhasePartiallyFailed {
|
||||
resultsNote = fmt.Sprintf(" (run velero restore describe %s or velero restore logs %s for more information)", restore.Name, restore.Name)
|
||||
}
|
||||
|
||||
d.Printf("Phase:\t%s%s\n", restore.Status.Phase, resultsNote)
|
||||
|
||||
if len(restore.Status.ValidationErrors) > 0 {
|
||||
d.Println()
|
||||
|
||||
Reference in New Issue
Block a user