mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-08 22:23:15 +00:00
add "Deleting" phase for restore display (#6604)
Signed-off-by: allenxu404 <qix2@vmware.com>
This commit is contained in:
@@ -59,6 +59,13 @@ func NewGetCommand(f client.Factory, use string) *cobra.Command {
|
||||
cmd.CheckError(err)
|
||||
}
|
||||
|
||||
// Append "(Deleting)" to phase if deletionTimestamp is marked.
|
||||
for i := range restores.Items {
|
||||
if !restores.Items[i].DeletionTimestamp.IsZero() {
|
||||
restores.Items[i].Status.Phase += " (Deleting)"
|
||||
}
|
||||
}
|
||||
|
||||
if printed, err := output.PrintWithFormat(c, restores); printed || err != nil {
|
||||
cmd.CheckError(err)
|
||||
return
|
||||
|
||||
@@ -45,6 +45,12 @@ func DescribeRestore(ctx context.Context, kbClient kbclient.Client, restore *vel
|
||||
phase = velerov1api.RestorePhaseNew
|
||||
}
|
||||
phaseString := string(phase)
|
||||
|
||||
// Append "Deleting" to phaseString if deletionTimestamp is marked.
|
||||
if !restore.DeletionTimestamp.IsZero() {
|
||||
phaseString += " (Deleting)"
|
||||
}
|
||||
|
||||
switch phase {
|
||||
case velerov1api.RestorePhaseCompleted:
|
||||
phaseString = color.GreenString(phaseString)
|
||||
|
||||
Reference in New Issue
Block a user