From cfbb9f5ea40b3b654d7b6f9ad861877e97ed24be Mon Sep 17 00:00:00 2001
From: jikai <jikai11@huawei.com>
Date: Thu, 11 Apr 2024 02:04:47 +0000
Subject: [PATCH 52/69] init enable_pod_events as false

Signed-off-by: jikai <jikai11@huawei.com>
---
 src/daemon/entry/connect/grpc/cri/cri_service.cc               | 3 +--
 src/daemon/entry/connect/grpc/cri/cri_service.h                | 1 -
 .../connect/grpc/cri/v1/cri_v1_runtime_runtime_service.cc      | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/daemon/entry/connect/grpc/cri/cri_service.cc b/src/daemon/entry/connect/grpc/cri/cri_service.cc
index d10a60b5..80bcfef0 100644
--- a/src/daemon/entry/connect/grpc/cri/cri_service.cc
+++ b/src/daemon/entry/connect/grpc/cri/cri_service.cc
@@ -89,9 +89,8 @@ int CRIService::Init(const isulad_daemon_configs *config)
 
 #ifdef ENABLE_CRI_API_V1
     m_enableCRIV1 = config->enable_cri_v1;
-    m_enablePodEvents = config->enable_pod_events;
     if (m_enableCRIV1) {
-        m_runtimeV1RuntimeService.Init(m_podSandboxImage, m_pluginManager, m_enablePodEvents, err);
+        m_runtimeV1RuntimeService.Init(m_podSandboxImage, m_pluginManager, config->enable_pod_events, err);
         if (err.NotEmpty()) {
             ERROR("Init CRI v1 runtime service failed: %s", err.GetCMessage());
             return -1;
diff --git a/src/daemon/entry/connect/grpc/cri/cri_service.h b/src/daemon/entry/connect/grpc/cri/cri_service.h
index 041c7c63..77b2eb72 100644
--- a/src/daemon/entry/connect/grpc/cri/cri_service.h
+++ b/src/daemon/entry/connect/grpc/cri/cri_service.h
@@ -56,7 +56,6 @@ private:
     std::string m_podSandboxImage;
     std::shared_ptr<Network::PluginManager> m_pluginManager;
     bool m_enableCRIV1;
-    bool m_enablePodEvents;
 };
 
 }
diff --git a/src/daemon/entry/connect/grpc/cri/v1/cri_v1_runtime_runtime_service.cc b/src/daemon/entry/connect/grpc/cri/v1/cri_v1_runtime_runtime_service.cc
index bc5ab591..e2591ce0 100644
--- a/src/daemon/entry/connect/grpc/cri/v1/cri_v1_runtime_runtime_service.cc
+++ b/src/daemon/entry/connect/grpc/cri/v1/cri_v1_runtime_runtime_service.cc
@@ -62,6 +62,7 @@ void RuntimeV1RuntimeServiceImpl::Init(std::string &podSandboxImage,
         return;
     }
 
+    m_enablePodEvents = false;
     if (enablePodEvents) {
         if (mailbox_register_topic_handler(MAILBOX_TOPIC_CRI_CONTAINER, cri_container_topic_handler,
                                            this, cri_container_topic_release, true) != 0) {
@@ -72,7 +73,6 @@ void RuntimeV1RuntimeServiceImpl::Init(std::string &podSandboxImage,
         m_enablePodEvents = enablePodEvents;
     }
 
-
     m_rService = std::unique_ptr<CRIV1::CRIRuntimeService>(new CRIRuntimeServiceImpl(podSandboxImage, cb, networkPlugin, m_enablePodEvents));
 }
 
-- 
2.34.1

