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>pull/2248/head
parent
bdb9145375
commit
fd95a59cf7
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue