mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-04 12:14:00 +00:00
bug fix: don't panic on nil restic repo maintenance time (#2315)
* bug fix: don't panic on nil restic repo maintenance time Signed-off-by: Steve Kriss <krisss@vmware.com> * changelog Signed-off-by: Steve Kriss <krisss@vmware.com>
This commit is contained in:
committed by
Steve Kriss
parent
0665b05321
commit
981e92c3e7
1
changelogs/unreleased/2315-skriss
Normal file
1
changelogs/unreleased/2315-skriss
Normal file
@@ -0,0 +1 @@
|
||||
bug fix: don't panic in `velero restic repo get` when last maintenance time is `nil`
|
||||
@@ -52,9 +52,11 @@ func printResticRepo(repo *v1.ResticRepository) []metav1.TableRow {
|
||||
status = v1.ResticRepositoryPhaseNew
|
||||
}
|
||||
|
||||
lastMaintenance := repo.Status.LastMaintenanceTime.String()
|
||||
if repo.Status.LastMaintenanceTime.IsZero() {
|
||||
var lastMaintenance string
|
||||
if repo.Status.LastMaintenanceTime == nil || repo.Status.LastMaintenanceTime.IsZero() {
|
||||
lastMaintenance = "<never>"
|
||||
} else {
|
||||
lastMaintenance = repo.Status.LastMaintenanceTime.String()
|
||||
}
|
||||
|
||||
row.Cells = append(row.Cells,
|
||||
|
||||
Reference in New Issue
Block a user