@@ -19,6 +19,7 @@ package docker
1919import (
2020 "bytes"
2121 "context"
22+ "fmt"
2223 "net"
2324 "net/http"
2425 "net/http/httputil"
@@ -140,24 +141,24 @@ func (d *RuntimeManagerDockerServer) failOver(dockerClient proxyDockerClient) er
140141 }
141142
142143 for _ , c := range containers {
143- podID := c .Labels [types .SandboxIDLabelKey ]
144- podCheckPoint := store .GetPodSandboxInfo (podID )
145- if podCheckPoint == nil {
146- klog .Errorf ("no pod info related to containerID %v" , c .ID )
147- continue
148- }
149- store .WriteContainerInfo (c .ID , & store.ContainerInfo {
144+ cInfo := & store.ContainerInfo {
150145 ContainerResourceHookRequest : & v1alpha1.ContainerResourceHookRequest {
151- PodMeta : podCheckPoint .PodMeta ,
152146 ContainerResources : HostConfigToResource (c .ContainerJSON .HostConfig ),
153147 ContainerAnnotations : c .Labels ,
154148 ContainerMata : & v1alpha1.ContainerMetadata {
155149 Name : c .Name ,
156150 Id : c .ID ,
157151 },
158- PodResources : podCheckPoint .Resources ,
159152 },
160- })
153+ }
154+ podID := c .Labels [types .SandboxIDLabelKey ]
155+ podCheckPoint := store .GetPodSandboxInfo (podID )
156+ if podCheckPoint != nil {
157+ cInfo .ContainerResourceHookRequest .PodMeta = podCheckPoint .PodMeta
158+ cInfo .ContainerResourceHookRequest .PodResources = podCheckPoint .Resources
159+ continue
160+ }
161+ store .WriteContainerInfo (c .ID , cInfo )
161162 }
162163 info , err := dockerClient .Info (context .TODO ())
163164 if err != nil {
@@ -191,8 +192,7 @@ func (d *RuntimeManagerDockerServer) Run() error {
191192
192193 err = d .failOver (dockerClient )
193194 if err != nil {
194- //FIXME: need to panic?
195- klog .Errorf ("Failed to backup container info from backend, err: %v" , err )
195+ panic (fmt .Sprintf ("Failed to backup container info from backend, err: %v" , err ))
196196 }
197197
198198 lis , err := net .Listen ("unix" , options .RuntimeProxyEndpoint )
0 commit comments