Skip to content

Commit d1e03f3

Browse files
authored
Merge pull request kubernetes#127195 from yaojunyu/fix-pod-alway-restart-open-envetedpleg
EventedPLEG: Set Timestamp in PodStatus for Generic PLEG more accurate
2 parents 429edc5 + 02c6df0 commit d1e03f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/kubelet/kuberuntime/kuberuntime_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ func (m *kubeGenericRuntimeManager) GetPodStatus(ctx context.Context, uid kubety
15381538

15391539
sandboxStatuses := []*runtimeapi.PodSandboxStatus{}
15401540
containerStatuses := []*kubecontainer.Status{}
1541-
var timestamp time.Time
1541+
timestamp := time.Now()
15421542

15431543
podIPs := []string{}
15441544
for idx, podSandboxID := range podSandboxIDs {
@@ -1582,7 +1582,7 @@ func (m *kubeGenericRuntimeManager) GetPodStatus(ctx context.Context, uid kubety
15821582
} else {
15831583
// Get the statuses of all containers visible to the pod and
15841584
// timestamp from sandboxStatus.
1585-
timestamp = time.Unix(resp.Timestamp, 0)
1585+
timestamp = time.Unix(0, resp.Timestamp)
15861586
for _, cs := range resp.ContainersStatuses {
15871587
cStatus := m.convertToKubeContainerStatus(cs)
15881588
containerStatuses = append(containerStatuses, cStatus)

0 commit comments

Comments
 (0)