From 7fcad1955e55c5c94553d8102eb1df2f7824ba34 Mon Sep 17 00:00:00 2001 From: Julio Chana Date: Tue, 5 Mar 2019 15:59:38 +0100 Subject: [PATCH] Check for nil pointer when getting minimum redis pod time Signed-off-by: Julio Chana --- operator/redisfailover/service/check.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/operator/redisfailover/service/check.go b/operator/redisfailover/service/check.go index 0e2437b83..9f3541ef5 100644 --- a/operator/redisfailover/service/check.go +++ b/operator/redisfailover/service/check.go @@ -212,6 +212,9 @@ func (r *RedisFailoverChecker) GetMinimumRedisPodTime(rf *redisfailoverv1alpha2. return minTime, err } for _, redisNode := range rps.Items { + if redisNode.Status.StartTime == nil { + continue + } start := redisNode.Status.StartTime.Round(time.Second) alive := time.Now().Sub(start) r.logger.Debugf("Pod %s has been alive for %.f seconds", redisNode.Status.PodIP, alive.Seconds())