mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-02 09:47:06 +00:00
Log more info of container for debugging.
This commit is contained in:
@@ -693,7 +693,7 @@ func (dm *DockerManager) runContainer(
|
|||||||
securityContextProvider.ModifyHostConfig(pod, container, dockerOpts.HostConfig)
|
securityContextProvider.ModifyHostConfig(pod, container, dockerOpts.HostConfig)
|
||||||
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 {
|
||||||
@@ -774,7 +774,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)
|
||||||
@@ -799,13 +799,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
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1275,7 +1275,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)
|
||||||
@@ -1307,7 +1307,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
|
||||||
|
Reference in New Issue
Block a user