From c56563a5cfb85fcba9f28dd1df9647037eb2931e Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Sat, 20 Jan 2024 09:57:05 +0000 Subject: automatic import of iSulad --- ...-save-sandbox-to-disk-after-network-ready.patch | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 0038-save-sandbox-to-disk-after-network-ready.patch (limited to '0038-save-sandbox-to-disk-after-network-ready.patch') diff --git a/0038-save-sandbox-to-disk-after-network-ready.patch b/0038-save-sandbox-to-disk-after-network-ready.patch new file mode 100644 index 0000000..b77ff29 --- /dev/null +++ b/0038-save-sandbox-to-disk-after-network-ready.patch @@ -0,0 +1,68 @@ +From e33b7915d9ef5092252bc3ce5d93fbde74d73990 Mon Sep 17 00:00:00 2001 +From: jikai +Date: Mon, 27 Nov 2023 15:09:39 +0800 +Subject: [PATCH 38/64] save sandbox to disk after network ready + +Signed-off-by: jikai +--- + .../cri/v1/v1_cri_pod_sandbox_manager_service.cc | 13 ++++++++++--- + src/daemon/sandbox/sandbox.cc | 6 ------ + 2 files changed, 10 insertions(+), 9 deletions(-) + +diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc +index 0f6b8508..a0c45111 100644 +--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc ++++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc +@@ -358,14 +358,21 @@ auto PodSandboxManagerService::RunPodSandbox(const runtime::v1::PodSandboxConfig + goto cleanup_sandbox; + } + +- // Step 8: Call sandbox create. ++ // Step 8: Save sandbox to disk ++ sandbox->Save(error); ++ if (error.NotEmpty()) { ++ ERROR("Failed to save sandbox, %s", sandboxName.c_str()); ++ goto cleanup_network; ++ } ++ ++ // Step 9: Call sandbox create. + sandbox->Create(error); + if (error.NotEmpty()) { + ERROR("Failed to create sandbox: %s", sandboxName.c_str()); + goto cleanup_network; + } + +- // Step 9: Save network settings json to disk ++ // Step 10: Save network settings json to disk + // Update network settings before start sandbox since sandbox container will use the sandbox key + if (namespace_is_cni(networkMode.c_str())) { + Errors tmpErr; +@@ -376,7 +383,7 @@ auto PodSandboxManagerService::RunPodSandbox(const runtime::v1::PodSandboxConfig + } + } + +- // Step 10: Call sandbox start. ++ // Step 11: Call sandbox start. + sandbox->Start(error); + if (error.NotEmpty()) { + ERROR("Failed to start sandbox: %s", sandboxName.c_str()); +diff --git a/src/daemon/sandbox/sandbox.cc b/src/daemon/sandbox/sandbox.cc +index b1832265..9fe9fa48 100644 +--- a/src/daemon/sandbox/sandbox.cc ++++ b/src/daemon/sandbox/sandbox.cc +@@ -599,12 +599,6 @@ void Sandbox::PrepareSandboxDirs(Errors &error) + goto out; + } + +- if (!Save(error)) { +- error.Errorf("Failed to save sandbox, %s", m_id.c_str()); +- ERROR("Failed to save sandbox, %s", m_id.c_str()); +- goto out; +- } +- + umask(mask); + return; + +-- +2.42.0 + -- cgit v1.2.3