Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupTestCerts ¶
SetupTestCerts populates the given test directory with server certificates.
Since generating certificates is CPU intensive, they will be simply symlink'ed from the test/deps/ directory.
FIXME: this function is exported because some tests use it directly. Eventually we should rework those tests to use NewTestOS instead.
Types ¶
type InotifyInfo ¶
type InotifyInfo struct {
Fd int
sync.RWMutex
Targets map[string]*InotifyTargetInfo
}
InotifyInfo records the inotify information associated with a given inotify instance.
type InotifyTargetInfo ¶
InotifyTargetInfo records the inotify information associated with a given inotify target.
type OS ¶
type OS struct {
// Directories
CacheDir string // Cache directory (e.g. /var/cache/incus/).
LogDir string // Log directory (e.g. /var/log/incus/).
VarDir string // Data directory (e.g. /var/lib/incus/).
// Daemon environment
Architectures []int // Cache of detected system architectures
BackingFS string // Backing filesystem of $INCUS_DIR/containers
ExecPath string // Absolute path to the daemon
IdmapSet *idmap.IdmapSet // Information about user/group ID mapping
InotifyWatch InotifyInfo
LxcPath string // Path to the $INCUS_DIR/containers directory
MockMode bool // If true some APIs will be mocked (for testing)
Nodev bool
RunningInUserNS bool
// Privilege dropping
UnprivUser string
UnprivUID uint32
UnprivGroup string
UnprivGID uint32
// Apparmor features
AppArmorAdmin bool
AppArmorAvailable bool
AppArmorConfined bool
AppArmorStacked bool
AppArmorStacking bool
// Cgroup features
CGInfo cgroup.Info
// Kernel features
CloseRange bool
CoreScheduling bool
IdmappedMounts bool
NetnsGetifaddrs bool
PidFdSetns bool
SeccompListener bool
SeccompListenerContinue bool
UeventInjection bool
VFS3Fscaps bool
ContainerCoreScheduling bool
NativeTerminals bool
PidFds bool
SeccompListenerAddfd bool
// LXC features
LXCFeatures map[string]bool
// OS info
ReleaseInfo map[string]string
KernelVersion version.DottedVersion
Uname *linux.Utsname
BootTime time.Time
}
OS is a high-level facade for accessing operating-system level functionalities.
func DefaultOS ¶
func DefaultOS() *OS
DefaultOS returns a fresh uninitialized OS instance with default values.
func (*OS) GlobalDatabaseDir ¶
GlobalDatabaseDir returns the path of the global database directory.
func (*OS) GlobalDatabasePath ¶
GlobalDatabasePath returns the path of the global database SQLite file managed by dqlite.
func (*OS) InitStorage ¶
InitStorage initialises the storage layer after it has been mounted.
func (*OS) LocalDatabasePath ¶
LocalDatabasePath returns the path of the local database file.