Merge pull request #127195 from yaojunyu/fix-pod-alway-restart-open-envetedpleg

EventedPLEG: Set Timestamp in PodStatus for Generic PLEG more accurate
This commit is contained in:
Kubernetes Prow Robot 2024-10-14 23:36:20 +01:00 committed by GitHub
commit d1e03f3a77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1538,7 +1538,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 {
@ -1582,7 +1582,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)