Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions userspace/libsinsp/filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ sinsp_filter_check_list::sinsp_filter_check_list()
add_filter_check(new sinsp_filter_check_container());
add_filter_check(new sinsp_filter_check_utils());
add_filter_check(new sinsp_filter_check_fdlist());
#ifndef HAS_ANALYZER
add_filter_check(new sinsp_filter_check_k8s());
#endif // HAS_ANALYZER
#ifndef CYGWING_AGENT
add_filter_check(new sinsp_filter_check_k8s());
add_filter_check(new sinsp_filter_check_mesos());
#endif
add_filter_check(new sinsp_filter_check_tracer());
Expand Down
44 changes: 42 additions & 2 deletions userspace/libsinsp/filterchecks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6514,7 +6514,7 @@ uint8_t* sinsp_filter_check_fdlist::extract(sinsp_evt *evt, OUT uint32_t* len, b
}
}

#ifndef HAS_ANALYZER
#ifndef CYGWING_AGENT

///////////////////////////////////////////////////////////////////////////////
// sinsp_filter_check_k8s implementation
Expand Down Expand Up @@ -6648,6 +6648,45 @@ int32_t sinsp_filter_check_k8s::extract_arg(const string& fldname, const string&
return parsed_len;
}

#ifdef HAS_ANALYZER

// When using the analyzer, the necessary state is not collected, so
// these methods all return no info.

const k8s_pod_t* sinsp_filter_check_k8s::find_pod_for_thread(const sinsp_threadinfo* tinfo)
{
return NULL;
}

const k8s_ns_t* sinsp_filter_check_k8s::find_ns_by_name(const string& ns_name)
{
return NULL;
}

const k8s_rc_t* sinsp_filter_check_k8s::find_rc_by_pod(const k8s_pod_t* pod)
{
return NULL;
}

const k8s_rs_t* sinsp_filter_check_k8s::find_rs_by_pod(const k8s_pod_t* pod)
{
return NULL;
}

vector<const k8s_service_t*> sinsp_filter_check_k8s::find_svc_by_pod(const k8s_pod_t* pod)
{

vector<const k8s_service_t *> empty;

return empty;
}

const k8s_deployment_t* sinsp_filter_check_k8s::find_deployment_by_pod(const k8s_pod_t* pod)
{
return NULL;
}

#else
const k8s_pod_t* sinsp_filter_check_k8s::find_pod_for_thread(const sinsp_threadinfo* tinfo)
{
if(tinfo->m_container_id.empty())
Expand Down Expand Up @@ -6729,6 +6768,7 @@ const k8s_deployment_t* sinsp_filter_check_k8s::find_deployment_by_pod(const k8s

return NULL;
}
#endif

void sinsp_filter_check_k8s::concatenate_labels(const k8s_pair_list& labels, string* s)
{
Expand Down Expand Up @@ -7060,7 +7100,7 @@ uint8_t* sinsp_filter_check_k8s::extract(sinsp_evt *evt, OUT uint32_t* len, bool
return NULL;
}

#endif // HAS_ANALYZER
#endif // CYGWING_AGENT

///////////////////////////////////////////////////////////////////////////////
// sinsp_filter_check_mesos implementation
Expand Down
4 changes: 2 additions & 2 deletions userspace/libsinsp/filterchecks.h
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ class sinsp_filter_check_fdlist : public sinsp_filter_check
char m_addrbuff[100];
};

#ifndef HAS_ANALYZER
#ifndef CYGWING_AGENT

class sinsp_filter_check_k8s : public sinsp_filter_check
{
Expand Down Expand Up @@ -914,7 +914,7 @@ class sinsp_filter_check_k8s : public sinsp_filter_check
string m_tstr;
};

#endif // HAS_ANALYZER
#endif // CYGWING_AGENT

#ifndef CYGWING_AGENT
class sinsp_filter_check_mesos : public sinsp_filter_check
Expand Down