Skip to content

Commit 9dcd044

Browse files
authored
fix(host): upload container status when not created (#23667)
1 parent 2c622fe commit 9dcd044

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/hostman/guestman/pod.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ func (s *sPodGuestInstance) getStatus(ctx context.Context, defaultStatus string)
341341
if s.IsRunning() {
342342
status = computeapi.VM_RUNNING
343343
}
344-
for _, c := range s.containers {
344+
for _, c := range s.GetContainers() {
345345
cStatus, cs, err := s.getContainerStatus(ctx, c.Id)
346346
if err != nil {
347347
log.Errorf("get container %s status of pod %s", c.Id, s.Id)
@@ -372,7 +372,7 @@ func (s *sPodGuestInstance) GetUploadStatus(ctx context.Context, reason string)
372372
}*/
373373
// sync container's status
374374
cStatuss := make(map[string]*computeapi.ContainerPerformStatusInput)
375-
for _, c := range s.containers {
375+
for _, c := range s.GetContainers() {
376376
cStatus, cs, err := s.getContainerStatus(ctx, c.Id)
377377
if err != nil {
378378
log.Errorf("get container %s status of pod %s", c.Id, s.Id)

0 commit comments

Comments
 (0)