diff --git a/pkg/node/statusfunc.go b/pkg/node/statusfunc.go index 6df2f0a4..94e249c3 100644 --- a/pkg/node/statusfunc.go +++ b/pkg/node/statusfunc.go @@ -45,7 +45,9 @@ type statusEvents struct { // kubectl get pods -o json type podStatusList struct { Items []struct { - Name string `json:"name"` + Metadata struct { + Name string `json:"name"` + } `json:"metadata"` Status struct { ContainerStatuses []struct { ContainerID string `json:"containerID"` @@ -149,13 +151,15 @@ func SystemPodsRunningFunc(h *cluster.Host) retryFunc { for _, p := range pods.Items { if p.Status.Phase != "Running" { - log.Debugf("%s: pod %s phase '%s'", h, p.Name, p.Status.Phase) + log.Debugf("%s: pod %s phase '%s'", h, p.Metadata.Name, p.Status.Phase) continue } running++ for _, c := range p.Status.ContainerStatuses { if !c.Ready { log.Debugf("%s: container %s not ready %s (%s)", h, c.Name, c.State.Waiting.Reason, c.State.Waiting.Message) + _ = h.Exec(h.Configurer.KubectlCmdf(h, h.K0sDataDir(), "-n kube-system logs %s -c %s %s", p.Metadata.Name, c.Name), exec.Sudo(h)) + continue } ready++