Skip to content
Open
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
3 changes: 2 additions & 1 deletion src/exporters/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ pub fn get_docker_client() -> Result<Docker, std::io::Error> {

#[cfg(feature = "containers")]
pub fn get_kubernetes_client() -> Result<Kubernetes, KubernetesError> {
let kube_config_path = std::env::var("KUBECONFIG").ok();
match Kubernetes::connect(
Some(String::from("/root/.kube/config")),
kube_config_path,
None,
None,
None,
Expand Down
5 changes: 5 additions & 0 deletions src/sensors/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ impl ProcessTracker {
}
if container_id.contains("cri-containerd") {
container_id = container_id.split(':').last().unwrap().to_string();
// cgroup name sometimes look like cri-containerd-[actual container_id] so we take
// that into account
if container_id.contains("cri-containerd") {
container_id = container_id.split('-').last().unwrap().to_string();
}
}
Ok(container_id)
}
Expand Down