mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-04 12:14:00 +00:00
Change B/R describe cli to support kopia
Signed-off-by: allenxu404 <qix2@vmware.com>
This commit is contained in:
1
changelogs/unreleased/5412-allenxu404
Normal file
1
changelogs/unreleased/5412-allenxu404
Normal file
@@ -0,0 +1 @@
|
||||
Change B/R describe CLI to support Kopia
|
||||
@@ -403,10 +403,19 @@ func failedDeletionCount(requests []velerov1api.DeleteBackupRequest) int {
|
||||
|
||||
// DescribePodVolumeBackups describes pod volume backups in human-readable format.
|
||||
func DescribePodVolumeBackups(d *Describer, backups []velerov1api.PodVolumeBackup, details bool) {
|
||||
if details {
|
||||
d.Printf("Restic Backups:\n")
|
||||
// Get the type of pod volume uploader. Since the uploader only comes from a single source, we can
|
||||
// take the uploader type from the first element of the array.
|
||||
var uploaderType string
|
||||
if len(backups) > 0 {
|
||||
uploaderType = backups[0].Spec.UploaderType
|
||||
} else {
|
||||
d.Printf("Restic Backups (specify --details for more information):\n")
|
||||
return
|
||||
}
|
||||
|
||||
if details {
|
||||
d.Printf("%s Backups:\n", uploaderType)
|
||||
} else {
|
||||
d.Printf("%s Backups (specify --details for more information):\n", uploaderType)
|
||||
}
|
||||
|
||||
// separate backups by phase (combining <none> and New into a single group)
|
||||
|
||||
@@ -205,10 +205,19 @@ func describeRestoreResult(d *Describer, name string, result pkgrestore.Result)
|
||||
|
||||
// describePodVolumeRestores describes pod volume restores in human-readable format.
|
||||
func describePodVolumeRestores(d *Describer, restores []velerov1api.PodVolumeRestore, details bool) {
|
||||
if details {
|
||||
d.Printf("Restic Restores:\n")
|
||||
// Get the type of pod volume uploader. Since the uploader only comes from a single source, we can
|
||||
// take the uploader type from the first element of the array.
|
||||
var uploaderType string
|
||||
if len(restores) > 0 {
|
||||
uploaderType = restores[0].Spec.UploaderType
|
||||
} else {
|
||||
d.Printf("Restic Restores (specify --details for more information):\n")
|
||||
return
|
||||
}
|
||||
|
||||
if details {
|
||||
d.Printf("%s Restores:\n", uploaderType)
|
||||
} else {
|
||||
d.Printf("%s Restores (specify --details for more information):\n", uploaderType)
|
||||
}
|
||||
|
||||
// separate restores by phase (combining <none> and New into a single group)
|
||||
|
||||
Reference in New Issue
Block a user