diff --git a/changelogs/unreleased/2200-sseago b/changelogs/unreleased/2200-sseago new file mode 100644 index 000000000..5b3569d89 --- /dev/null +++ b/changelogs/unreleased/2200-sseago @@ -0,0 +1 @@ +Bug fix: Check for nil LastMaintenanceTime in ResticRepository dueForMaintenance diff --git a/pkg/controller/restic_repository_controller.go b/pkg/controller/restic_repository_controller.go index dce0fa46d..ccc7db630 100644 --- a/pkg/controller/restic_repository_controller.go +++ b/pkg/controller/restic_repository_controller.go @@ -243,7 +243,7 @@ func (c *resticRepositoryController) runMaintenanceIfDue(req *v1.ResticRepositor } func dueForMaintenance(req *v1.ResticRepository, now time.Time) bool { - return req.Status.LastMaintenanceTime.Add(req.Spec.MaintenanceFrequency.Duration).Before(now) + return req.Status.LastMaintenanceTime == nil || req.Status.LastMaintenanceTime.Add(req.Spec.MaintenanceFrequency.Duration).Before(now) } func (c *resticRepositoryController) checkNotReadyRepo(req *v1.ResticRepository, log logrus.FieldLogger) error {