mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Merge pull request #29442 from xiangpengzhao/fix-log-info
Automatic merge from submit-queue Log more info of container for debugging.
This commit is contained in:
commit
e628f6fa1d
@ -699,7 +699,7 @@ func (dm *DockerManager) runContainer(
|
|||||||
securityContextProvider.ModifyHostConfig(pod, container, dockerOpts.HostConfig, supplementalGids)
|
securityContextProvider.ModifyHostConfig(pod, container, dockerOpts.HostConfig, supplementalGids)
|
||||||
createResp, err := dm.client.CreateContainer(dockerOpts)
|
createResp, err := dm.client.CreateContainer(dockerOpts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
dm.recorder.Eventf(ref, api.EventTypeWarning, events.FailedToCreateContainer, "Failed to create docker container with error: %v", err)
|
dm.recorder.Eventf(ref, api.EventTypeWarning, events.FailedToCreateContainer, "Failed to create docker container %q of pod %q with error: %v", container.Name, format.Pod(pod), err)
|
||||||
return kubecontainer.ContainerID{}, err
|
return kubecontainer.ContainerID{}, err
|
||||||
}
|
}
|
||||||
if len(createResp.Warnings) != 0 {
|
if len(createResp.Warnings) != 0 {
|
||||||
@ -780,7 +780,7 @@ func (dm *DockerManager) GetContainers(all bool) ([]*kubecontainer.Container, er
|
|||||||
for _, c := range containers {
|
for _, c := range containers {
|
||||||
converted, err := toRuntimeContainer(c)
|
converted, err := toRuntimeContainer(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Error examining the container: %v", err)
|
glog.Errorf("Error examining the container %v: %v", c.ID, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
result = append(result, converted)
|
result = append(result, converted)
|
||||||
@ -805,13 +805,13 @@ func (dm *DockerManager) GetPods(all bool) ([]*kubecontainer.Pod, error) {
|
|||||||
for _, c := range containers {
|
for _, c := range containers {
|
||||||
converted, err := toRuntimeContainer(c)
|
converted, err := toRuntimeContainer(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Error examining the container: %v", err)
|
glog.Errorf("Error examining the container %v: %v", c.ID, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
podUID, podName, podNamespace, err := getPodInfoFromContainer(c)
|
podUID, podName, podNamespace, err := getPodInfoFromContainer(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Error examining the container: %v", err)
|
glog.Errorf("Error examining the container %v: %v", c.ID, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1287,7 +1287,7 @@ func (dm *DockerManager) killPodWithSyncResult(pod *api.Pod, runningPod kubecont
|
|||||||
err := dm.KillContainerInPod(container.ID, containerSpec, pod, "Need to kill pod.", gracePeriodOverride)
|
err := dm.KillContainerInPod(container.ID, containerSpec, pod, "Need to kill pod.", gracePeriodOverride)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
killContainerResult.Fail(kubecontainer.ErrKillContainer, err.Error())
|
killContainerResult.Fail(kubecontainer.ErrKillContainer, err.Error())
|
||||||
glog.Errorf("Failed to delete container: %v; Skipping pod %q", err, runningPod.ID)
|
glog.Errorf("Failed to delete container %v: %v; Skipping pod %q", container.ID.ID, err, runningPod.ID)
|
||||||
}
|
}
|
||||||
containerResults <- killContainerResult
|
containerResults <- killContainerResult
|
||||||
}(container)
|
}(container)
|
||||||
@ -1319,7 +1319,7 @@ func (dm *DockerManager) killPodWithSyncResult(pod *api.Pod, runningPod kubecont
|
|||||||
result.AddSyncResult(killContainerResult)
|
result.AddSyncResult(killContainerResult)
|
||||||
if err := dm.KillContainerInPod(networkContainer.ID, networkSpec, pod, "Need to kill pod.", gracePeriodOverride); err != nil {
|
if err := dm.KillContainerInPod(networkContainer.ID, networkSpec, pod, "Need to kill pod.", gracePeriodOverride); err != nil {
|
||||||
killContainerResult.Fail(kubecontainer.ErrKillContainer, err.Error())
|
killContainerResult.Fail(kubecontainer.ErrKillContainer, err.Error())
|
||||||
glog.Errorf("Failed to delete container: %v; Skipping pod %q", err, runningPod.ID)
|
glog.Errorf("Failed to delete container %v: %v; Skipping pod %q", networkContainer.ID.ID, err, runningPod.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user