mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
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:
commit
d1e03f3a77
@ -1538,7 +1538,7 @@ func (m *kubeGenericRuntimeManager) GetPodStatus(ctx context.Context, uid kubety
|
|||||||
|
|
||||||
sandboxStatuses := []*runtimeapi.PodSandboxStatus{}
|
sandboxStatuses := []*runtimeapi.PodSandboxStatus{}
|
||||||
containerStatuses := []*kubecontainer.Status{}
|
containerStatuses := []*kubecontainer.Status{}
|
||||||
var timestamp time.Time
|
timestamp := time.Now()
|
||||||
|
|
||||||
podIPs := []string{}
|
podIPs := []string{}
|
||||||
for idx, podSandboxID := range podSandboxIDs {
|
for idx, podSandboxID := range podSandboxIDs {
|
||||||
@ -1582,7 +1582,7 @@ func (m *kubeGenericRuntimeManager) GetPodStatus(ctx context.Context, uid kubety
|
|||||||
} else {
|
} else {
|
||||||
// Get the statuses of all containers visible to the pod and
|
// Get the statuses of all containers visible to the pod and
|
||||||
// timestamp from sandboxStatus.
|
// timestamp from sandboxStatus.
|
||||||
timestamp = time.Unix(resp.Timestamp, 0)
|
timestamp = time.Unix(0, resp.Timestamp)
|
||||||
for _, cs := range resp.ContainersStatuses {
|
for _, cs := range resp.ContainersStatuses {
|
||||||
cStatus := m.convertToKubeContainerStatus(cs)
|
cStatus := m.convertToKubeContainerStatus(cs)
|
||||||
containerStatuses = append(containerStatuses, cStatus)
|
containerStatuses = append(containerStatuses, cStatus)
|
||||||
|
Loading…
Reference in New Issue
Block a user