utils

package
v0.0.0-...-45a9bcf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package utils is a compliance internal submodule implementing various utilies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContainerOverlayPath

func GetContainerOverlayPath(pid int32) (string, error)

GetContainerOverlayPath tries to extract the directory mounted as root mountpoint of the given process. To do so it parses the mountinfo table of the process and tries to match it with the mount entry of the root namespace (mountinfo pid 1).

func GetFileGroup

func GetFileGroup(fi os.FileInfo) string

GetFileGroup returns the file group.

func GetFileUser

func GetFileUser(fi os.FileInfo) string

GetFileUser returns the file user.

func GetProcessRootPath

func GetProcessRootPath(pid int32) (string, bool)

GetProcessRootPath returns the process root path of the given PID.

Types

type ContainerID

type ContainerID string

ContainerID wraps a string representing a container identifier.

func GetProcessContainerID

func GetProcessContainerID(pid int32) (ContainerID, bool)

GetProcessContainerID returns the container ID associated with the given process ID. Returns an empty string if no container found.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL