diff --git a/pkg/controller/nodes/gate/handler.go b/pkg/controller/nodes/gate/handler.go index 5c6d1a512f..31e21c4dc5 100644 --- a/pkg/controller/nodes/gate/handler.go +++ b/pkg/controller/nodes/gate/handler.go @@ -185,8 +185,8 @@ func (g *gateNodeHandler) Handle(ctx context.Context, nCtx handler.NodeExecution sleepDuration := sleepCondition.GetDuration().AsDuration() // check duration of node sleep - now := time.Now() - if sleepDuration <= now.Sub(nCtx.NodeStatus().GetLastAttemptStartedAt().Time) { + lastAttemptStartedAt := nCtx.NodeStatus().GetLastAttemptStartedAt() + if lastAttemptStartedAt != nil && sleepDuration <= time.Since(lastAttemptStartedAt.Time) { return handler.DoTransition(handler.TransitionTypeEphemeral, handler.PhaseInfoSuccess(&handler.ExecutionInfo{})), nil } default: