Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertBuild(build *parser.UnitFile, names map[string]string) (*parser.UnitFile, string, error)
- func ConvertContainer(container *parser.UnitFile, names map[string]string, isUser bool, ...) (*parser.UnitFile, error)
- func ConvertImage(image *parser.UnitFile) (*parser.UnitFile, string, error)
- func ConvertKube(kube *parser.UnitFile, names map[string]string, isUser bool) (*parser.UnitFile, error)
- func ConvertNetwork(network *parser.UnitFile, name string) (*parser.UnitFile, string, error)
- func ConvertPod(podUnit *parser.UnitFile, name string, podsInfoMap map[string]*PodInfo, ...) (*parser.UnitFile, error)
- func ConvertVolume(volume *parser.UnitFile, name string, names map[string]string) (*parser.UnitFile, string, error)
- func GetBuiltImageName(buildUnit *parser.UnitFile) string
- func GetPodServiceName(podUnit *parser.UnitFile) string
- type PodInfo
- type PodmanCmdline
Constants ¶
const ( // Directory for global Quadlet files (sysadmin owned) UnitDirAdmin = "/etc/containers/systemd" // Directory for global Quadlet files (distro owned) UnitDirDistro = "/usr/share/containers/systemd" // Names of commonly used systemd/quadlet group names ContainerGroup = "Container" InstallGroup = "Install" KubeGroup = "Kube" NetworkGroup = "Network" PodGroup = "Pod" ServiceGroup = "Service" UnitGroup = "Unit" VolumeGroup = "Volume" ImageGroup = "Image" BuildGroup = "Build" XContainerGroup = "X-Container" XKubeGroup = "X-Kube" XNetworkGroup = "X-Network" XPodGroup = "X-Pod" XVolumeGroup = "X-Volume" XImageGroup = "X-Image" XBuildGroup = "X-Build" )
const ( KeyAddCapability = "AddCapability" KeyAddDevice = "AddDevice" KeyAllTags = "AllTags" KeyAnnotation = "Annotation" KeyArch = "Arch" KeyAuthFile = "AuthFile" KeyAutoUpdate = "AutoUpdate" KeyCertDir = "CertDir" KeyConfigMap = "ConfigMap" KeyContainerName = "ContainerName" KeyContainersConfModule = "ContainersConfModule" KeyCopy = "Copy" KeyCreds = "Creds" KeyDecryptionKey = "DecryptionKey" KeyDevice = "Device" KeyDisableDNS = "DisableDNS" KeyDNS = "DNS" KeyDNSOption = "DNSOption" KeyDNSSearch = "DNSSearch" KeyDriver = "Driver" KeyDropCapability = "DropCapability" KeyEntrypoint = "Entrypoint" KeyEnvironment = "Environment" KeyEnvironmentFile = "EnvironmentFile" KeyEnvironmentHost = "EnvironmentHost" KeyExec = "Exec" KeyExitCodePropagation = "ExitCodePropagation" KeyExposeHostPort = "ExposeHostPort" KeyFile = "File" KeyForceRM = "ForceRM" KeyGateway = "Gateway" KeyGIDMap = "GIDMap" KeyGlobalArgs = "GlobalArgs" KeyGroup = "Group" KeyGroupAdd = "GroupAdd" KeyHealthCmd = "HealthCmd" KeyHealthInterval = "HealthInterval" KeyHealthOnFailure = "HealthOnFailure" KeyHealthRetries = "HealthRetries" KeyHealthStartPeriod = "HealthStartPeriod" KeyHealthStartupCmd = "HealthStartupCmd" KeyHealthStartupInterval = "HealthStartupInterval" KeyHealthStartupRetries = "HealthStartupRetries" KeyHealthStartupSuccess = "HealthStartupSuccess" KeyHealthStartupTimeout = "HealthStartupTimeout" KeyHealthTimeout = "HealthTimeout" KeyHostName = "HostName" KeyImage = "Image" KeyImageTag = "ImageTag" KeyInternal = "Internal" KeyIP = "IP" KeyIP6 = "IP6" KeyIPAMDriver = "IPAMDriver" KeyIPRange = "IPRange" KeyIPv6 = "IPv6" KeyKubeDownForce = "KubeDownForce" KeyLabel = "Label" KeyLogDriver = "LogDriver" KeyLogOpt = "LogOpt" KeyMask = "Mask" KeyMount = "Mount" KeyNetwork = "Network" KeyNetworkAlias = "NetworkAlias" KeyNetworkName = "NetworkName" KeyNoNewPrivileges = "NoNewPrivileges" KeyNotify = "Notify" KeyOptions = "Options" KeyOS = "OS" KeyPidsLimit = "PidsLimit" KeyPod = "Pod" KeyPodmanArgs = "PodmanArgs" KeyPodName = "PodName" KeyPublishPort = "PublishPort" KeyPull = "Pull" KeyReadOnly = "ReadOnly" KeyReadOnlyTmpfs = "ReadOnlyTmpfs" KeyRemapGid = "RemapGid" //nolint:stylecheck // deprecated KeyRemapUid = "RemapUid" //nolint:stylecheck // deprecated KeyRemapUidSize = "RemapUidSize" //nolint:stylecheck // deprecated KeyRemapUsers = "RemapUsers" // deprecated KeyRootfs = "Rootfs" KeyRunInit = "RunInit" KeySeccompProfile = "SeccompProfile" KeySecret = "Secret" KeySecurityLabelDisable = "SecurityLabelDisable" KeySecurityLabelFileType = "SecurityLabelFileType" KeySecurityLabelLevel = "SecurityLabelLevel" KeySecurityLabelNested = "SecurityLabelNested" KeySecurityLabelType = "SecurityLabelType" KeySetWorkingDirectory = "SetWorkingDirectory" KeyShmSize = "ShmSize" KeyStopTimeout = "StopTimeout" KeySubGIDMap = "SubGIDMap" KeySubnet = "Subnet" KeySubUIDMap = "SubUIDMap" KeySysctl = "Sysctl" KeyTarget = "Target" KeyTimezone = "Timezone" KeyTLSVerify = "TLSVerify" KeyTmpfs = "Tmpfs" KeyType = "Type" KeyUIDMap = "UIDMap" KeyUlimit = "Ulimit" KeyUnmask = "Unmask" KeyUser = "User" KeyUserNS = "UserNS" KeyVariant = "Variant" KeyVolatileTmp = "VolatileTmp" // deprecated KeyVolume = "Volume" KeyVolumeName = "VolumeName" KeyWorkingDir = "WorkingDir" KeyYaml = "Yaml" )
All the supported quadlet keys
const (
ServiceKeyWorkingDirectory = "WorkingDirectory"
)
Systemd Unit file keys
Variables ¶
var (
URL = regexp.Delayed(`^((https?)|(git)://)|(github\.com/).+$`)
)
Functions ¶
func ConvertBuild ¶ added in v5.2.0
func ConvertContainer ¶
func ConvertContainer(container *parser.UnitFile, names map[string]string, isUser bool, podsInfoMap map[string]*PodInfo) (*parser.UnitFile, error)
Convert a quadlet container file (unit file with a Container group) to a systemd service file (unit file with Service group) based on the options in the Container group. The original Container group is kept around as X-Container.
func ConvertKube ¶
func ConvertNetwork ¶
Convert a quadlet network file (unit file with a Network group) to a systemd service file (unit file with Service group) based on the options in the Network group. The original Network group is kept around as X-Network. Also returns the canonical network name, either auto-generated or user-defined via the NetworkName key-value.
func ConvertPod ¶
func ConvertVolume ¶
func ConvertVolume(volume *parser.UnitFile, name string, names map[string]string) (*parser.UnitFile, string, error)
Convert a quadlet volume file (unit file with a Volume group) to a systemd service file (unit file with Service group) based on the options in the Volume group. The original Volume group is kept around as X-Volume. Also returns the canonical volume name, either auto-generated or user-defined via the VolumeName key-value.
func GetBuiltImageName ¶ added in v5.2.0
func GetPodServiceName ¶
Types ¶
type PodmanCmdline ¶
type PodmanCmdline struct {
Args []string
}
This is a helper for constructing podman commandlines
func NewPodmanCmdline ¶
func NewPodmanCmdline(args ...string) *PodmanCmdline