diff --git a/src/libs/k8scontext.cpp b/src/libs/k8scontext.cpp index 96bef76..5e7d571 100644 --- a/src/libs/k8scontext.cpp +++ b/src/libs/k8scontext.cpp @@ -163,34 +163,35 @@ void K8sContext::clearPods() { void K8sContext::clearAllPods() { m_pods.clear(); } void K8sContext::updateAndWritePodState(std::string &uid) { - /* SF_DEBUG(m_logger, "Update and write pod state for modified pod: " << uid) - const k8s_state_t &k8sState = - m_cxt->getInspector()->m_k8s_client->get_state(); - const k8s_pod_t *pod = - k8sState.get_component(k8sState.get_pods(), uid); - - if (pod != nullptr) { - std::shared_ptr podO = getPod(uid); - if (podO == nullptr) { - SF_DEBUG(m_logger, - "Unable to find pod object in cache. Ignoring pod modification: " - << uid) - return; - } - - std::shared_ptr podObj = createPod(pod, k8sState); - if (podObj != nullptr) { - podObj->refs = podO->refs; - m_pods[pod->get_uid()] = podObj; - m_writer->writePod(&(podObj->pod)); - podObj->written = true; - } else { - SF_DEBUG(m_logger, "Unable to find pod with uid" << uid) - } - } else { - SF_DEBUG(m_logger, - "Unable to find pod with uid " << uid << " in global k8s state. ") - }*/ + /* SF_DEBUG(m_logger, "Update and write pod state for modified pod: " << uid) + const k8s_state_t &k8sState = + m_cxt->getInspector()->m_k8s_client->get_state(); + const k8s_pod_t *pod = + k8sState.get_component(k8sState.get_pods(), uid); + + if (pod != nullptr) { + std::shared_ptr podO = getPod(uid); + if (podO == nullptr) { + SF_DEBUG(m_logger, + "Unable to find pod object in cache. Ignoring pod modification: + " + << uid) + return; + } + + std::shared_ptr podObj = createPod(pod, k8sState); + if (podObj != nullptr) { + podObj->refs = podO->refs; + m_pods[pod->get_uid()] = podObj; + m_writer->writePod(&(podObj->pod)); + podObj->written = true; + } else { + SF_DEBUG(m_logger, "Unable to find pod with uid" << uid) + } + } else { + SF_DEBUG(m_logger, + "Unable to find pod with uid " << uid << " in global k8s state. ") + }*/ } void K8sContext::updateCompState(sysflow::K8sAction action, diff --git a/src/libs/k8scontext.h b/src/libs/k8scontext.h index e4e70d7..9290f6f 100644 --- a/src/libs/k8scontext.h +++ b/src/libs/k8scontext.h @@ -38,9 +38,9 @@ class K8sContext { PodTable m_pods; context::SysFlowContext *m_cxt; writer::SysFlowWriter *m_writer; - /* std::shared_ptr createPod(const k8s_pod_t *p, - const k8s_state_t &k8sState); - */ + /* std::shared_ptr createPod(const k8s_pod_t *p, + const k8s_state_t &k8sState); + */ public: K8sContext(context::SysFlowContext *cxt, writer::SysFlowWriter *writer); virtual ~K8sContext(); diff --git a/src/libs/sysflowcontext.cpp b/src/libs/sysflowcontext.cpp index 5f3585d..0025c2e 100644 --- a/src/libs/sysflowcontext.cpp +++ b/src/libs/sysflowcontext.cpp @@ -153,7 +153,7 @@ SysFlowContext::SysFlowContext(SysFlowConfig *config) if (k8sURL != nullptr) { SF_INFO(m_logger, "Initing k8s client. URL: " << k8sURL << " and certificate: " << k8sCert) - //m_inspector->init_k8s_client(k8sURL, k8sCert, &config->exporterID, true); + // m_inspector->init_k8s_client(k8sURL, k8sCert, &config->exporterID, true); m_inspector->set_internal_events_mode(true); m_k8sEnabled = true; } diff --git a/src/libs/sysflowprocessor.cpp b/src/libs/sysflowprocessor.cpp index 0d253c3..a760497 100644 --- a/src/libs/sysflowprocessor.cpp +++ b/src/libs/sysflowprocessor.cpp @@ -192,13 +192,13 @@ int SysFlowProcessor::run() { continue; } - /* if (m_cxt->getInspector()->m_k8s_client != nullptr && - m_cxt->getInspector()->m_k8s_client->get_capture_events().size() > 0) { - SF_INFO(m_logger, - "Events Count: " << m_cxt->getInspector() - ->m_k8s_client->get_capture_events() - .size()); - }*/ + /* if (m_cxt->getInspector()->m_k8s_client != nullptr && + m_cxt->getInspector()->m_k8s_client->get_capture_events().size() > 0) { + SF_INFO(m_logger, + "Events Count: " << m_cxt->getInspector() + ->m_k8s_client->get_capture_events() + .size()); + }*/ switch (ev->get_type()) { SF_EXECVE_ENTER()