mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 20:42:26 +00:00
Treat Timestamp as nanoseconds which response by PodSandboxStatus(e.g. CRI-O) and fix zero Timestamp without setting (e.g. containerd) change to now.
This commit is contained in:
parent
2108e54f52
commit
02c6df0436
@ -1536,7 +1536,7 @@ func (m *kubeGenericRuntimeManager) GetPodStatus(ctx context.Context, uid kubety
|
||||
|
||||
sandboxStatuses := []*runtimeapi.PodSandboxStatus{}
|
||||
containerStatuses := []*kubecontainer.Status{}
|
||||
var timestamp time.Time
|
||||
timestamp := time.Now()
|
||||
|
||||
podIPs := []string{}
|
||||
for idx, podSandboxID := range podSandboxIDs {
|
||||
@ -1580,7 +1580,7 @@ func (m *kubeGenericRuntimeManager) GetPodStatus(ctx context.Context, uid kubety
|
||||
} else {
|
||||
// Get the statuses of all containers visible to the pod and
|
||||
// timestamp from sandboxStatus.
|
||||
timestamp = time.Unix(resp.Timestamp, 0)
|
||||
timestamp = time.Unix(0, resp.Timestamp)
|
||||
for _, cs := range resp.ContainersStatuses {
|
||||
cStatus := m.convertToKubeContainerStatus(cs)
|
||||
containerStatuses = append(containerStatuses, cStatus)
|
||||
|
Loading…
Reference in New Issue
Block a user