mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-06 13:26:26 +00:00
Merge pull request #2440 from skriss/backup-progress
report backup progress
This commit is contained in:
@@ -632,6 +632,7 @@ func (s *server) runControllers(defaultVolumeSnapshotLocations map[string]string
|
||||
|
||||
backupControllerRunInfo := func() controllerRunInfo {
|
||||
backupper, err := backup.NewKubernetesBackupper(
|
||||
s.veleroClient.VeleroV1(),
|
||||
s.discoveryHelper,
|
||||
client.NewDynamicFactory(s.dynamicClient),
|
||||
podexec.NewPodCommandExecutor(s.kubeClientConfig, s.kubeClient.CoreV1().RESTClient()),
|
||||
|
||||
@@ -238,6 +238,18 @@ func DescribeBackupStatus(d *Describer, backup *velerov1api.Backup, details bool
|
||||
d.Printf("Expiration:\t%s\n", status.Expiration)
|
||||
d.Println()
|
||||
|
||||
if backup.Status.Progress != nil {
|
||||
if backup.Status.Phase == velerov1api.BackupPhaseInProgress {
|
||||
d.Printf("Estimated total items to be backed up:\t%d\n", backup.Status.Progress.TotalItems)
|
||||
d.Printf("Items backed up so far:\t%d\n", backup.Status.Progress.ItemsBackedUp)
|
||||
} else {
|
||||
d.Printf("Total items to be backed up:\t%d\n", backup.Status.Progress.TotalItems)
|
||||
d.Printf("Items backed up:\t%d\n", backup.Status.Progress.ItemsBackedUp)
|
||||
}
|
||||
|
||||
d.Println()
|
||||
}
|
||||
|
||||
if details {
|
||||
describeBackupResourceList(d, backup, veleroClient, insecureSkipTLSVerify, caCertPath)
|
||||
d.Println()
|
||||
|
||||
Reference in New Issue
Block a user