From f28c0ed8838676d54bd7312ddfb8fe4ab40d0c9a Mon Sep 17 00:00:00 2001 From: chen524 Date: Thu, 18 Jan 2024 09:02:26 +0000 Subject: [PATCH 1/2] update src/daemon/entry/cri/network_plugin.cc. Signed-off-by: chen524 --- src/daemon/entry/cri/network_plugin.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/daemon/entry/cri/network_plugin.cc b/src/daemon/entry/cri/network_plugin.cc index f8f9c7e60..f832a94f6 100644 --- a/src/daemon/entry/cri/network_plugin.cc +++ b/src/daemon/entry/cri/network_plugin.cc @@ -152,7 +152,7 @@ static void GetOnePodIP(std::string nsenterPath, std::string netnsPath, std::str } std::string tIP = ParseIPFromLine(lines[i], stdout_str); if (tIP.empty()) { - error.Errorf("parse %s to ip failed", lines[i]); + error.Errorf("Parse %s to ip failed", lines[i]); break; } ips.push_back(tIP); @@ -213,7 +213,7 @@ void InitNetworkPlugin(std::vector> *plugins, std std::string tmpName = (*it)->Name(); // qualify plugin name if (pluginMap.find(tmpName) != pluginMap.end()) { - allErr += ("network plugin " + tmpName + "was registered more than once"); + allErr += ("Network plugin " + tmpName + "was registered more than once"); continue; } @@ -342,7 +342,7 @@ void PodNetworkStatus::SetIPs(std::vector &ips) void PluginManager::Lock(const std::string &fullPodName, Errors &error) { if (pthread_mutex_lock(&m_podsLock) != 0) { - error.SetError("plugin manager lock failed"); + error.SetError("Plugin manager lock failed"); return; } auto iter = m_pods.find(fullPodName); @@ -352,7 +352,7 @@ void PluginManager::Lock(const std::string &fullPodName, Errors &error) if (tmpLock == nullptr) { error.SetError("Out of memory"); if (pthread_mutex_unlock(&m_podsLock) != 0) { - error.SetError("plugin manager unlock failed"); + error.SetError("Plugin manager unlock failed"); } return; } @@ -364,7 +364,7 @@ void PluginManager::Lock(const std::string &fullPodName, Errors &error) lock->Increase(); if (pthread_mutex_unlock(&m_podsLock) != 0) { - error.SetError("plugin manager unlock failed"); + error.SetError("Plugin manager unlock failed"); } lock->Lock(error); @@ -373,7 +373,7 @@ void PluginManager::Lock(const std::string &fullPodName, Errors &error) void PluginManager::Unlock(const std::string &fullPodName, Errors &error) { if (pthread_mutex_lock(&m_podsLock) != 0) { - error.SetError("plugin manager lock failed"); + error.SetError("Plugin manager lock failed"); return; } @@ -396,7 +396,7 @@ void PluginManager::Unlock(const std::string &fullPodName, Errors &error) } unlock: if (pthread_mutex_unlock(&m_podsLock) != 0) { - error.SetError("plugin manager unlock failed"); + error.SetError("Plugin manager unlock failed"); } } @@ -662,7 +662,7 @@ static void ParseOneLineNetworkStats(std::string &headerLine, std::string &value static void ParseNetworkStats(const std::string &stdoutString, struct NetworkInterfaceStats &stats, Errors &error) { if (stdoutString.length() == 0) { - error.SetError("none command output"); + error.SetError("None command output"); return; } -- Gitee From 3065ffbb14da6adca1a92ec3feec4239cf2d7040 Mon Sep 17 00:00:00 2001 From: chen524 Date: Thu, 18 Jan 2024 09:05:13 +0000 Subject: [PATCH 2/2] update src/daemon/entry/cri/request_cache.cc. Signed-off-by: chen524 --- src/daemon/entry/cri/request_cache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/daemon/entry/cri/request_cache.cc b/src/daemon/entry/cri/request_cache.cc index 87876053e..6f6e5877d 100644 --- a/src/daemon/entry/cri/request_cache.cc +++ b/src/daemon/entry/cri/request_cache.cc @@ -58,7 +58,7 @@ std::string RequestCache::InsertRequest(const std::string &containerID, StreamRe GarbageCollection(); // If the cache is full, reject the request. if (m_ll.size() == MaxInFlight) { - ERROR("too many cache in flight!"); + ERROR("Too many cache in flight!"); return ""; } auto token = UniqueToken(); @@ -117,7 +117,7 @@ std::string RequestCache::UniqueToken() return token; } } - ERROR("create unique token failed!"); + ERROR("Create unique token failed!"); return ""; } -- Gitee