fn extract_pod_id_from_cgroup_path(&self, pathname: String) -> Result<String, std::io::Error> {
        let mut container_id = String::from(pathname.split('/').last().unwrap());
        if container_id.starts_with("docker-") {
            container_id = container_id.strip_prefix("docker-").unwrap().to_string();
        }
        if container_id.ends_with(".scope") {
            container_id = container_id.strip_suffix(".scope").unwrap().to_string();
        }
        Ok(container_id)
    }
/// Extracts the container_id from a cgroup path containing it.
Extracts the container_id from a cgroup path containing it.
Extracts the container_id from a cgroup path containing it .
fn extract_pod_id_from_cgroup_path(&self, pathname: String) -> Result<String, std::io::Error> {
        let mut container_id = String::from(pathname.split('/').last().unwrap());
        if container_id.starts_with("docker-") {
            container_id = container_id.strip_prefix("docker-").unwrap().to_string();
        }
        if container_id.ends_with(".scope") {
            container_id = container_id.strip_suffix(".scope").unwrap().to_string();
        }
        Ok(container_id)
    }
fn extract_pod_id_from_cgroup_path ( & self , pathname : String ) -> Result < String , std :: io :: Error > { let mut container_id = String :: from ( pathname . split ( '/' ) . last ( ) . unwrap ( ) ) ; if container_id . starts_with ( " " ) { container_id = container_id . strip_prefix ( " " ) . unwrap ( ) . to_string ( ) ; } if container_id . ends_with ( " " ) { container_id = container_id . strip_suffix ( " " ) . unwrap ( ) . to_string ( ) ; } Ok ( container_id ) }
Extracts the container_id from a cgroup path containing it.
Extracts the container_id from a cgroup path containing it .
&self
pathname
String
&self
pathname
String