Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

fix exception caused by nil timestamp #176

Open
wants to merge 1 commit into
base: release-0.3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pkg/util/k8sutil/k8sutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

apiv1 "github.com/kubeflow/common/pkg/apis/common/v1"
log "github.com/sirupsen/logrus"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
Expand Down Expand Up @@ -99,8 +99,12 @@ func FilterActivePods(pods []*v1.Pod) []*v1.Pod {
if IsPodActive(p) {
result = append(result, p)
} else {
ts := p.DeletionTimestamp
if ts == nil {
ts = &metav1.Time{}
}
log.Infof("Ignoring inactive pod %v/%v in state %v, deletion time %v",
p.Namespace, p.Name, p.Status.Phase, p.DeletionTimestamp)
p.Namespace, p.Name, p.Status.Phase, ts)
}
}
return result
Expand Down