From 63f4f9bc9c36825d85a14f6a33102194d30e12a7 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Fri, 7 Jun 2024 02:24:49 +1400
Subject: [PATCH 107/108] bugfix for start sandbox before setup network by
 default

Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
 .../entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc       | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
index f852f4df..bc3f4031 100644
--- a/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1alpha/cri_pod_sandbox_manager_service.cc
@@ -677,6 +677,9 @@ auto PodSandboxManagerService::RunPodSandbox(const runtime::v1alpha2::PodSandbox
 
         SetupSandboxNetwork(config, response_id, inspect_data, networkOptions, stdAnnos, network_setting_json, error);
         if (error.NotEmpty()) {
+            Errors stopError;
+            StopContainerHelper(response_id, stopError);
+            WARN("Error stop container: %s: %s", response_id.c_str(), stopError.GetCMessage());
             goto cleanup_ns;
         }
     }
-- 
2.25.1

