File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,7 @@ Optional<ino_t> get_inode(std::string_view path) {
314314// whether the binary is running in host or not. However, it does not work when
315315// running in a Docker in Docker environment.
316316bool is_running_in_host_namespace () {
317+ // linux procfs file that represents the cgroup namespace of the current process
317318 if (auto inode = get_inode (" /proc/self/ns/cgroup" )) {
318319 return *inode == HOST_CGROUP_NAMESPACE_INODE;
319320 }
@@ -339,7 +340,7 @@ Optional<Cgroup> get_cgroup_version() {
339340Optional<std::string> find_docker_container_id_from_cgroup () {
340341 constexpr std::string_view cgroup_path = " /proc/self/cgroup" ;
341342
342- auto cgroup_fd = std::ifstream (cgroup_path. data () , std::ios::in);
343+ auto cgroup_fd = std::ifstream (" /proc/self/cgroup " , std::ios::in);
343344 if (!cgroup_fd.is_open ()) return nullopt ;
344345
345346 return find_docker_container_id (cgroup_fd);
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ Optional<std::string> find_docker_container_id(std::istream& source);
9494
9595// / Function to retrieve the container metadata.
9696// /
97- // / @return A `ContainerMetadata ` object containing metadata of the container in
97+ // / @return A `ContainerID ` object containing id of the container in
9898// / which the current process is running.
9999Optional<ContainerID> get_id ();
100100
You can’t perform that action at this time.
0 commit comments