mirror of
https://github.com/containers/podman.git
synced 2026-02-05 15:45:08 +01:00
use name_to_handle_at and open_by_handle_at to persist rootless namespaces without needing a pause process. The namespace file handles are stored in a file and can be used to rejoin the namespaces, as long as the namespaces still exist. Fall back to the pause process approach only when the kernel doesn't support nsfs handles (EOPNOTSUPP). The feature is currently only enabled when the PODMAN_NO_PAUSE_PROCESS environment variable is set. These changes in the kernel are required (landed in Linux 6.18): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3ab378cfa793 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
46 lines
1.3 KiB
Go
46 lines
1.3 KiB
Go
//go:build windows
|
|
|
|
package util
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"path/filepath"
|
|
|
|
"go.podman.io/storage/pkg/homedir"
|
|
)
|
|
|
|
var errNotImplemented = errors.New("not yet implemented")
|
|
|
|
// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 unified mode.
|
|
func IsCgroup2UnifiedMode() (bool, error) {
|
|
return false, fmt.Errorf("IsCgroup2Unified: %w", errNotImplemented)
|
|
}
|
|
|
|
// GetContainerPidInformationDescriptors returns a string slice of all supported
|
|
// format descriptors of GetContainerPidInformation.
|
|
func GetContainerPidInformationDescriptors() ([]string, error) {
|
|
return nil, fmt.Errorf("GetContainerPidInformationDescriptors: %w", errNotImplemented)
|
|
}
|
|
|
|
// GetRootlessStateDir returns the directory that holds the rootless state
|
|
// (pause.pid and ns_handles files).
|
|
func GetRootlessStateDir() (string, error) {
|
|
return "", fmt.Errorf("GetRootlessStateDir: %w", errNotImplemented)
|
|
}
|
|
|
|
// GetRootlessRuntimeDir returns the runtime directory
|
|
func GetRootlessRuntimeDir() (string, error) {
|
|
data, err := homedir.GetDataHome()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
runtimeDir := filepath.Join(data, "containers", "podman")
|
|
return runtimeDir, nil
|
|
}
|
|
|
|
// GetRootlessConfigHomeDir returns the config home directory when running as non root
|
|
func GetRootlessConfigHomeDir() (string, error) {
|
|
return "", errors.New("this function is not implemented for windows")
|
|
}
|