From 9dcd044e830fa57dcee18d5c47fd9dafb8ce5be3 Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Mon, 3 Nov 2025 15:53:56 +0800 Subject: [PATCH] fix(host): upload container status when not created (#23667) --- pkg/hostman/guestman/pod.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/hostman/guestman/pod.go b/pkg/hostman/guestman/pod.go index f14f2eb3c6..164e9106a6 100644 --- a/pkg/hostman/guestman/pod.go +++ b/pkg/hostman/guestman/pod.go @@ -341,7 +341,7 @@ func (s *sPodGuestInstance) getStatus(ctx context.Context, defaultStatus string) if s.IsRunning() { status = computeapi.VM_RUNNING } - for _, c := range s.containers { + for _, c := range s.GetContainers() { cStatus, cs, err := s.getContainerStatus(ctx, c.Id) if err != nil { 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) }*/ // sync container's status cStatuss := make(map[string]*computeapi.ContainerPerformStatusInput) - for _, c := range s.containers { + for _, c := range s.GetContainers() { cStatus, cs, err := s.getContainerStatus(ctx, c.Id) if err != nil { log.Errorf("get container %s status of pod %s", c.Id, s.Id)