Documentation ¶
Index ¶
- Constants
- Variables
- func ExitCode(err error) int
- func IsReservedAnnotation(value string) bool
- func TranslateExecErrorToExitCode(originalEC int, err error) int
- func ValidateRestartPolicy(policy string) error
- func ValidateSdNotifyMode(mode string) error
- type Address
- type AttachStreams
- type CPUUsage
- type CRIUCheckpointRestoreStatistics
- type ConmonInfo
- type ContainerExecStatus
- type ContainerNetworkStats
- type ContainerStats
- type ContainerStatus
- type ContainerStore
- type DiffType
- type DistributionInfo
- type DriverData
- type FileInfo
- type HealthCheckLog
- type HealthCheckOnFailureAction
- type HealthCheckResults
- type HealthCheckStatus
- type HostInfo
- type IDMappings
- type ImageStore
- type Info
- type InfoData
- type InspectAdditionalNetwork
- type InspectBasicNetworkConfig
- type InspectBlkioThrottleDevice
- type InspectBlkioWeightDevice
- type InspectContainerConfig
- type InspectContainerData
- type InspectContainerHostConfig
- type InspectContainerState
- type InspectDevice
- type InspectExecProcess
- type InspectExecSession
- type InspectHostPort
- type InspectIDMappings
- type InspectLogConfig
- type InspectMount
- type InspectNetworkSettings
- type InspectPodContainerInfo
- type InspectPodData
- type InspectPodInfraConfig
- type InspectRestartPolicy
- type InspectSecret
- type InspectUlimit
- type InspectVolumeData
- type KubeExitCodePropagation
- type OCIRuntimeInfo
- type PastaInfo
- type Plugins
- type RemoteSocket
- type RuntimeStateStore
- type SecurityInfo
- type SlirpInfo
- type StartupHealthCheck
- type StoreInfo
- type Version
- type VolumeReload
Constants ¶
const ( // RunOCIMountContextType tells the OCI runtime which context mount // type to use. context, rootcontext, fscontext, defcontext RunOCIMountContextType = "run.oci.mount_context_type" // RunOCIKeepOriginalGroups tells the OCI runtime to leak the users // current groups into the container RunOCIKeepOriginalGroups = "run.oci.keep_original_groups" // InspectAnnotationCIDFile is used by Inspect to determine if a // container ID file was created for the container. // If an annotation with this key is found in the OCI spec, it will be // used in the output of Inspect(). InspectAnnotationCIDFile = "io.podman.annotations.cid-file" // InspectAnnotationAutoremove is used by Inspect to determine if a // container will be automatically removed on exit. // If an annotation with this key is found in the OCI spec and is one of // the two supported boolean values (InspectResponseTrue and // InspectResponseFalse) it will be used in the output of Inspect(). InspectAnnotationAutoremove = "io.podman.annotations.autoremove" // InspectAnnotationAutoremoveImage is used by Inspect to identify // containers which will automatically remove the image used by the // container. If an annotation with this key is found in the OCI spec and // is one of the two supported boolean values (InspectResponseTrue and // InspectResponseFalse) it will be used in the output of Inspect(). InspectAnnotationAutoremoveImage = "io.podman.annotations.autoremove-image" // InspectAnnotationPrivileged is used by Inspect to identify containers // which are privileged (IE, running with elevated privileges). // It is expected to be a boolean, populated by one of // InspectResponseTrue or InspectResponseFalse. // If an annotation with this key is found in the OCI spec, it will be // used in the output of Inspect(). InspectAnnotationPrivileged = "io.podman.annotations.privileged" // InspectAnnotationPublishAll is used by Inspect to identify containers // which have all the ports from their image published. // It is expected to be a boolean, populated by one of // InspectResponseTrue or InspectResponseFalse. // If an annotation with this key is found in the OCI spec, it will be // used in the output of Inspect(). InspectAnnotationPublishAll = "io.podman.annotations.publish-all" // InspectAnnotationInit is used by Inspect to identify containers that // mount an init binary in. // It is expected to be a boolean, populated by one of // InspectResponseTrue or InspectResponseFalse. // If an annotation with this key is found in the OCI spec, it will be // used in the output of Inspect(). InspectAnnotationInit = "io.podman.annotations.init" // InspectAnnotationLabel is used by Inspect to identify containers with // special SELinux-related settings. It is used to populate the output // of the SecurityOpt setting. // If an annotation with this key is found in the OCI spec, it will be // used in the output of Inspect(). InspectAnnotationLabel = "io.podman.annotations.label" // InspectAnnotationSeccomp is used by Inspect to identify containers // with special Seccomp-related settings. It is used to populate the // output of the SecurityOpt setting in Inspect. // If an annotation with this key is found in the OCI spec, it will be // used in the output of Inspect(). InspectAnnotationSeccomp = "io.podman.annotations.seccomp" // InspectAnnotationApparmor is used by Inspect to identify containers // with special Apparmor-related settings. It is used to populate the // output of the SecurityOpt setting. // If an annotation with this key is found in the OCI spec, it will be // used in the output of Inspect(). InspectAnnotationApparmor = "io.podman.annotations.apparmor" // InspectResponseTrue is a boolean True response for an inspect // annotation. InspectResponseTrue = "TRUE" // InspectResponseFalse is a boolean False response for an inspect // annotation. InspectResponseFalse = "FALSE" // CheckpointAnnotationName is used by Container Checkpoint when creating a // checkpoint image to specify the original human-readable name for the // container. CheckpointAnnotationName = "io.podman.annotations.checkpoint.name" // CheckpointAnnotationRawImageName is used by Container Checkpoint when // creating a checkpoint image to specify the original unprocessed name of // the image used to create the container (as specified by the user). CheckpointAnnotationRawImageName = "io.podman.annotations.checkpoint.rawImageName" // CheckpointAnnotationRootfsImageID is used by Container Checkpoint when // creating a checkpoint image to specify the original ID of the image used // to create the container. CheckpointAnnotationRootfsImageID = "io.podman.annotations.checkpoint.rootfsImageID" // CheckpointAnnotationRootfsImageName is used by Container Checkpoint when // creating a checkpoint image to specify the original image name used to // create the container. CheckpointAnnotationRootfsImageName = "io.podman.annotations.checkpoint.rootfsImageName" // CheckpointAnnotationPodmanVersion is used by Container Checkpoint when // creating a checkpoint image to specify the version of Podman used on the // host where the checkpoint was created. CheckpointAnnotationPodmanVersion = "io.podman.annotations.checkpoint.podman.version" // CheckpointAnnotationCriuVersion is used by Container Checkpoint when // creating a checkpoint image to specify the version of CRIU used on the // host where the checkpoint was created. CheckpointAnnotationCriuVersion = "io.podman.annotations.checkpoint.criu.version" // CheckpointAnnotationRuntimeName is used by Container Checkpoint when // creating a checkpoint image to specify the runtime used on the host where // the checkpoint was created. CheckpointAnnotationRuntimeName = "io.podman.annotations.checkpoint.runtime.name" // CheckpointAnnotationRuntimeVersion is used by Container Checkpoint when // creating a checkpoint image to specify the version of runtime used on the // host where the checkpoint was created. CheckpointAnnotationRuntimeVersion = "io.podman.annotations.checkpoint.runtime.version" // CheckpointAnnotationConmonVersion is used by Container Checkpoint when // creating a checkpoint image to specify the version of conmon used on // the host where the checkpoint was created. CheckpointAnnotationConmonVersion = "io.podman.annotations.checkpoint.conmon.version" // CheckpointAnnotationHostArch is used by Container Checkpoint when // creating a checkpoint image to specify the CPU architecture of the host // on which the checkpoint was created. CheckpointAnnotationHostArch = "io.podman.annotations.checkpoint.host.arch" // CheckpointAnnotationHostKernel is used by Container Checkpoint when // creating a checkpoint image to specify the kernel version used by the // host where the checkpoint was created. CheckpointAnnotationHostKernel = "io.podman.annotations.checkpoint.host.kernel" // CheckpointAnnotationCgroupVersion is used by Container Checkpoint when // creating a checkpoint image to specify the cgroup version used by the // host where the checkpoint was created. CheckpointAnnotationCgroupVersion = "io.podman.annotations.checkpoint.cgroups.version" // CheckpointAnnotationDistributionVersion is used by Container Checkpoint // when creating a checkpoint image to specify the version of host // distribution on which the checkpoint was created. CheckpointAnnotationDistributionVersion = "io.podman.annotations.checkpoint.distribution.version" // CheckpointAnnotationDistributionName is used by Container Checkpoint when // creating a checkpoint image to specify the name of host distribution on // which the checkpoint was created. CheckpointAnnotationDistributionName = "io.podman.annotations.checkpoint.distribution.name" // InitContainerType is used by play kube when playing a kube yaml to specify the type // of the init container. InitContainerType = "io.podman.annotations.init.container.type" // InfraNameAnnotation is used by generate and play kube when the infra container is set by the user during // pod creation InfraNameAnnotation = "io.podman.annotations.infra.name" // UserNsAnnotation is used by play kube when playing a kube yaml to specify userns // of the container UserNsAnnotation = "io.podman.annotations.userns" // UlimitAnnotation is used by kube play when playing a kube yaml to specify the ulimits // of the container UlimitAnnotation = "io.podman.annotations.ulimit" // VolumesFromAnnotation is used by by play kube when playing a kube // yaml to specify volumes-from of the container // It is expected to be a semicolon-separated list of container names and/or // IDs optionally with colon separated mount options. VolumesFromAnnotation = "io.podman.annotations.volumes-from" // KubeHealthCheckAnnotation is used by kube play to tell podman that any health checks should follow // the k8s behavior of waiting for the intialDelaySeconds to be over before updating the status KubeHealthCheckAnnotation = "io.podman.annotations.kube.health.check" // KubeImageAutomountAnnotation KubeImageAutomountAnnotation = "io.podman.annotations.kube.image.volumes.mount" // TotalAnnotationSizeLimitB is the max length of annotations allowed by Kubernetes. TotalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB )
const ( OCIManifestDir = "oci-dir" OCIArchive = "oci-archive" V2s2ManifestDir = "docker-dir" V2s2Archive = "docker-archive" )
const ( // RestartPolicyNone indicates that no restart policy has been requested // by a container. RestartPolicyNone = "" // RestartPolicyNo is identical in function to RestartPolicyNone. RestartPolicyNo = "no" // RestartPolicyAlways unconditionally restarts the container. RestartPolicyAlways = "always" // RestartPolicyOnFailure restarts the container on non-0 exit code, // with an optional maximum number of retries. RestartPolicyOnFailure = "on-failure" // RestartPolicyUnlessStopped unconditionally restarts unless stopped // by the user. It is identical to Always except with respect to // handling of system restart, which Podman does not yet support. RestartPolicyUnlessStopped = "unless-stopped" )
Valid restart policy types.
const ( // AlwaysInitContainer is an init container that runs on each // pod start (including restart) AlwaysInitContainer = "always" // OneShotInitContainer is a container that only runs as init once // and is then deleted. OneShotInitContainer = "once" // ContainerInitPath is the default path of the mounted container init. ContainerInitPath = "/run/podman-init" )
InitContainerTypes
const ( // A Pod kube yaml spec K8sKindPod = "pod" // A Deployment kube yaml spec K8sKindDeployment = "deployment" // A DaemonSet kube yaml spec K8sKindDaemonSet = "daemonset" // a Job kube yaml spec K8sKindJob = "job" )
Kubernetes Kinds
const ( // ExecErrorCodeGeneric is the default error code to return from an exec session if libpod failed // prior to calling the runtime ExecErrorCodeGeneric = 125 // ExecErrorCodeCannotInvoke is the error code to return when the runtime fails to invoke a command. // An example of this can be found by trying to execute a directory: // `podman exec -l /etc` ExecErrorCodeCannotInvoke = 126 // ExecErrorCodeNotFound is the error code to return when a command cannot be found ExecErrorCodeNotFound = 127 )
const ( // HealthCheckHealthy describes a healthy container HealthCheckHealthy string = "healthy" // HealthCheckUnhealthy describes an unhealthy container HealthCheckUnhealthy string = "unhealthy" // HealthCheckStarting describes the time between when the container starts // and the start-period (time allowed for the container to start and application // to be running) expires. HealthCheckStarting string = "starting" // HealthCheckReset describes reset of HealthCheck logs HealthCheckReset string = "reset" )
const ( // DefaultHealthCheckInterval default value DefaultHealthCheckInterval = "30s" // DefaultHealthCheckRetries default value DefaultHealthCheckRetries uint = 3 // DefaultHealthCheckStartPeriod default value DefaultHealthCheckStartPeriod = "0s" // DefaultHealthCheckTimeout default value DefaultHealthCheckTimeout = "30s" // DefaultHealthMaxLogCount default value DefaultHealthMaxLogCount uint = 5 // DefaultHealthMaxLogSize default value DefaultHealthMaxLogSize uint = 500 // DefaultHealthCheckLocalDestination default value DefaultHealthCheckLocalDestination string = "local" )
Healthcheck defaults. These are used both in the cli as well in libpod and were moved from cmd/podman/common
const ( // HealthConfigTestNone disables healthcheck HealthConfigTestNone = "NONE" // HealthConfigTestCmd execs arguments directly HealthConfigTestCmd = "CMD" // HealthConfigTestCmdShell runs commands with the system's default shell HealthConfigTestCmdShell = "CMD-SHELL" )
HealthConfig.Test options
const ( // HealthCheckOnFailureActionNonce instructs Podman to not react on an unhealthy status. HealthCheckOnFailureActionNone = iota // Must be first iota for backwards compatibility // HealthCheckOnFailureActionInvalid denotes an invalid on-failure policy. HealthCheckOnFailureActionInvalid = iota // HealthCheckOnFailureActionNonce instructs Podman to kill the container on an unhealthy status. HealthCheckOnFailureActionKill = iota // HealthCheckOnFailureActionNonce instructs Podman to restart the container on an unhealthy status. HealthCheckOnFailureActionRestart = iota // HealthCheckOnFailureActionNonce instructs Podman to stop the container on an unhealthy status. HealthCheckOnFailureActionStop = iota )
Healthcheck on-failure actions.
const ( // TypeDevpts is the type for creating a devpts TypeDevpts = "devpts" // TypeTmpfs is the type for mounting tmpfs TypeTmpfs = "tmpfs" // TypeRamfs is the type for mounting ramfs TypeRamfs = "ramfs" // TypeVolume is the type for named volumes TypeVolume = "volume" )
const ( // PodStateCreated indicates the pod is created but has not been started PodStateCreated = "Created" // PodStateErrored indicates the pod is in an errored state where // information about it can no longer be retrieved PodStateErrored = "Error" // PodStateExited indicates the pod ran but has been stopped PodStateExited = "Exited" // PodStatePaused indicates the pod has been paused PodStatePaused = "Paused" // PodStateRunning indicates that all of the containers in the pod are // running. PodStateRunning = "Running" // PodStateDegraded indicates that at least one, but not all, of the // containers in the pod are running. PodStateDegraded = "Degraded" // PodStateStopped indicates all of the containers belonging to the pod // are stopped. PodStateStopped = "Stopped" )
const ( SdNotifyModeConmon = "conmon" SdNotifyModeContainer = "container" SdNotifyModeHealthy = "healthy" SdNotifyModeIgnore = "ignore" )
Strings used for --sdnotify option to podman
const AutoUpdateAuthfileLabel = "io.containers.autoupdate.authfile"
AutoUpdateAuthfileLabel denotes the container label key to specify authfile in container labels.
const AutoUpdateLabel = "io.containers.autoupdate"
AutoUpdateLabel denotes the container/pod label key to specify auto-update policies in container labels.
const BindMountPrefix = "bind-mount-options"
BindMountPrefix distinguishes its annotations from others
const ( // DefaultTransport is a prefix that we apply to an image name // to check docker hub first for the image DefaultTransport = "docker://" )
const HealthCheckEventsLoggerDestination string = "events_logger"
const JSONLogging = "json-file"
JSONLogging is the string conmon expects when specifying to use the json logging format
const JournaldLogging = "journald"
JournaldLogging is the string conmon expects to specify journald logging
const KubernetesLogging = "k8s-file"
KubernetesLogging is the string conmon expects when specifying to use the kubernetes logging format
const NoLogging = "none"
NoLogging is the string conmon expects when specifying to use no log driver whatsoever
const PassthroughLogging = "passthrough"
PassthroughLogging is the string conmon expects when specifying to use the passthrough driver
const PassthroughTTYLogging = "passthrough-tty"
PassthroughTTYLogging is the string conmon expects when specifying to use the passthrough driver even on a tty.
const RLimitDefaultValue = uint64(1048576)
DefaultRlimitValue is the value set by default for nofile and nproc
const (
// TypeBind is the type for mounting host dir
TypeBind = "bind"
)
const VolumeDriverImage = "image"
VolumeDriverImage is the "image" volume driver. It is managed by Libpod and uses volumes backed by an image.
const VolumeDriverLocal = "local"
VolumeDriverLocal is the "local" volume driver. It is managed by libpod itself.
Variables ¶
var ( // DefaultSHMLockPath is the default path for SHM locks DefaultSHMLockPath = "/libpod_lock" // DefaultRootlessSHMLockPath is the default path for rootless SHM locks DefaultRootlessSHMLockPath = "/libpod_rootless_lock" // NameRegex is a regular expression to validate container/pod names. // This must NOT be changed from outside of Libpod. It should be a // constant, but Go won't let us do that. NameRegex = types.NameRegex // RegexError is thrown in presence of an invalid container/pod name. RegexError = types.RegexError )
var ( // ErrNoSuchCtr indicates the requested container does not exist ErrNoSuchCtr = errors.New("no such container") // ErrNoSuchPod indicates the requested pod does not exist ErrNoSuchPod = errors.New("no such pod") // ErrNoSuchVolume indicates the requested volume does not exist ErrNoSuchVolume = errors.New("no such volume") // ErrNoSuchNetwork indicates the requested network does not exist ErrNoSuchNetwork = types.ErrNoSuchNetwork // ErrNoSuchExecSession indicates that the requested exec session does // not exist. ErrNoSuchExecSession = errors.New("no such exec session") // ErrNoSuchExitCode indicates that the requested container exit code // does not exist. ErrNoSuchExitCode = errors.New("no such exit code") // ErrDepExists indicates that the current object has dependencies and // cannot be removed before them. ErrDepExists = errors.New("dependency exists") // ErrNoAliases indicates that the container does not have any network // aliases. ErrNoAliases = errors.New("no aliases for container") // ErrMissingPlugin indicates that the requested operation requires a // plugin that is not present on the system or in the configuration. ErrMissingPlugin = errors.New("required plugin missing") // ErrCtrExists indicates a container with the same name or ID already // exists ErrCtrExists = errors.New("container already exists") // ErrPodExists indicates a pod with the same name or ID already exists ErrPodExists = errors.New("pod already exists") // ErrImageExists indicates an image with the same ID already exists ErrImageExists = errors.New("image already exists") // ErrVolumeExists indicates a volume with the same name already exists ErrVolumeExists = errors.New("volume already exists") // ErrExecSessionExists indicates an exec session with the same ID // already exists. ErrExecSessionExists = errors.New("exec session already exists") // ErrNetworkExists indicates that a network with the given name already // exists. ErrNetworkExists = types.ErrNetworkExists // ErrCtrStateInvalid indicates a container is in an improper state for // the requested operation ErrCtrStateInvalid = errors.New("container state improper") // ErrCtrStateRunning indicates a container is running. ErrCtrStateRunning = errors.New("container is running") // ErrExecSessionStateInvalid indicates that an exec session is in an // improper state for the requested operation ErrExecSessionStateInvalid = errors.New("exec session state improper") // ErrVolumeBeingUsed indicates that a volume is being used by at least one container ErrVolumeBeingUsed = errors.New("volume is being used") // ErrRuntimeFinalized indicates that the runtime has already been // created and cannot be modified ErrRuntimeFinalized = errors.New("runtime has been finalized") // ErrCtrFinalized indicates that the container has already been created // and cannot be modified ErrCtrFinalized = errors.New("container has been finalized") // ErrPodFinalized indicates that the pod has already been created and // cannot be modified ErrPodFinalized = errors.New("pod has been finalized") // ErrVolumeFinalized indicates that the volume has already been created and // cannot be modified ErrVolumeFinalized = errors.New("volume has been finalized") // ErrInvalidArg indicates that an invalid argument was passed ErrInvalidArg = types.ErrInvalidArg // ErrEmptyID indicates that an empty ID was passed ErrEmptyID = errors.New("name or ID cannot be empty") // ErrInternal indicates an internal library error ErrInternal = errors.New("internal libpod error") // ErrPodPartialFail indicates that a pod operation was only partially // successful, and some containers within the pod failed. ErrPodPartialFail = errors.New("some containers failed") // ErrDetach indicates that an attach session was manually detached by // the user. ErrDetach = detach.ErrDetach // ErrWillDeadlock indicates that the requested operation will cause a // deadlock. This is usually caused by upgrade issues, and is resolved // by renumbering the locks. ErrWillDeadlock = errors.New("deadlock due to lock mismatch") // ErrNoCgroups indicates that the container does not have its own // Cgroup. ErrNoCgroups = errors.New("this container does not have a cgroup") // ErrNoLogs indicates that this container is not creating a log so log // operations cannot be performed on it ErrNoLogs = errors.New("this container is not logging output") // ErrRootless indicates that the given command cannot but run without // root. ErrRootless = errors.New("operation requires root privileges") // ErrRuntimeStopped indicates that the runtime has already been shut // down and no further operations can be performed on it ErrRuntimeStopped = errors.New("runtime has already been stopped") // ErrCtrStopped indicates that the requested container is not running // and the requested operation cannot be performed until it is started ErrCtrStopped = errors.New("container is stopped") // ErrCtrRemoved indicates that the container has already been removed // and no further operations can be performed on it ErrCtrRemoved = errors.New("container has already been removed") // ErrPodRemoved indicates that the pod has already been removed and no // further operations can be performed on it ErrPodRemoved = errors.New("pod has already been removed") // ErrVolumeRemoved indicates that the volume has already been removed and // no further operations can be performed on it ErrVolumeRemoved = errors.New("volume has already been removed") // ErrExecSessionRemoved indicates that the exec session has already // been removed and no further operations can be performed on it. ErrExecSessionRemoved = errors.New("exec session has already been removed") // ErrDBClosed indicates that the connection to the state database has // already been closed ErrDBClosed = errors.New("database connection already closed") // ErrDBBadConfig indicates that the database has a different schema or // was created by a libpod with a different config ErrDBBadConfig = errors.New("database configuration mismatch") // ErrNSMismatch indicates that the requested pod or container is in a // different namespace and cannot be accessed or modified. ErrNSMismatch = errors.New("target is in a different namespace") // ErrNotImplemented indicates that the requested functionality is not // yet present ErrNotImplemented = errors.New("not yet implemented") // ErrOSNotSupported indicates the function is not available on the particular // OS. ErrOSNotSupported = errors.New("no support for this OS yet") // ErrOCIRuntime indicates a generic error from the OCI runtime ErrOCIRuntime = errors.New("OCI runtime error") // ErrOCIRuntimePermissionDenied indicates the OCI runtime attempted to invoke a command that returned // a permission denied error ErrOCIRuntimePermissionDenied = errors.New("OCI permission denied") // ErrOCIRuntimeNotFound indicates the OCI runtime attempted to invoke a command // that was not found ErrOCIRuntimeNotFound = errors.New("OCI runtime attempted to invoke a command that was not found") // could not be found in the configuration ErrOCIRuntimeUnavailable = errors.New("OCI unavailable") // ErrConmonOutdated indicates the version of conmon found (whether via the configuration or $PATH) // is out of date for the current podman version ErrConmonOutdated = errors.New("outdated conmon version") // ErrConmonDead indicates that the container's conmon process has been // killed, preventing normal operation. ErrConmonDead = errors.New("conmon process killed") // ErrNetworkOnPodContainer indicates the user wishes to alter network attributes on a container // in a pod. This cannot be done as the infra container has all the network information ErrNetworkOnPodContainer = errors.New("network cannot be configured when it is shared with a pod") // ErrNetworkInUse indicates the requested operation failed because the network was in use ErrNetworkInUse = errors.New("network is being used") // ErrNetworkConnected indicates that the required operation failed because the container is already a network endpoint ErrNetworkConnected = errors.New("network is already connected") // ErrStoreNotInitialized indicates that the container storage was never // initialized. ErrStoreNotInitialized = errors.New("the container storage was never initialized") // ErrNoNetwork indicates that a container has no net namespace, like network=none ErrNoNetwork = errors.New("container has no network namespace") // ErrNetworkModeInvalid indicates that a container has the wrong network mode for an operation ErrNetworkModeInvalid = errors.New("invalid network mode") // ErrSetSecurityAttribute indicates that a request to set a container's security attribute // was not possible. ErrSetSecurityAttribute = fmt.Errorf("%w: unable to assign security attribute", ErrOCIRuntime) // ErrGetSecurityAttribute indicates that a request to get a container's security attribute // was not possible. ErrGetSecurityAttribute = fmt.Errorf("%w: unable to get security attribute", ErrOCIRuntime) // ErrSecurityAttribute indicates that an error processing security attributes // for the container ErrSecurityAttribute = fmt.Errorf("%w: unable to process security attribute", ErrOCIRuntime) // ErrCanceled indicates that an operation has been cancelled by a user. // Useful for potentially long running tasks. ErrCanceled = errors.New("cancelled by user") // ErrConmonVersionFormat is used when the expected version format of conmon // has changed. ErrConmonVersionFormat = "conmon version changed format" // ErrRemovingCtrs indicates that there was an error removing all // containers from a pod. ErrRemovingCtrs = errors.New("removing pod containers") )
var ( // Mount potions for bind BindOptions = []string{TypeBind} )
var RestartPolicyMap = map[string]string{ "none": RestartPolicyNone, RestartPolicyNo: RestartPolicyNo, RestartPolicyAlways: RestartPolicyAlways, RestartPolicyOnFailure: RestartPolicyOnFailure, RestartPolicyUnlessStopped: RestartPolicyUnlessStopped, }
RestartPolicyMap maps between restart-policy valid values to restart policy types
var SupportedHealthCheckOnFailureActions = []string{
strHealthCheckOnFailureActionNone,
strHealthCheckOnFailureActionKill,
strHealthCheckOnFailureActionRestart,
strHealthCheckOnFailureActionStop,
}
SupportedHealthCheckOnFailureActions lists all supported healthcheck restart policies.
Functions ¶
func ExitCode ¶
ExitCode reads the error message when failing to executing container process and then returns 0 if no error, ExecErrorCodeNotFound if command does not exist, or ExecErrorCodeCannotInvoke for all other errors
func IsReservedAnnotation ¶
IsReservedAnnotation returns true if the specified value corresponds to an already reserved annotation that Podman sets during container creation.
func TranslateExecErrorToExitCode ¶
TranslateExecErrorToExitCode takes an error and checks whether it has a predefined exit code associated. If so, it returns that, otherwise it returns the exit code originally stated in libpod.Exec()
func ValidateRestartPolicy ¶ added in v5.1.0
Validate that the given string is a valid restart policy.
func ValidateSdNotifyMode ¶
ValidateSdNotifyMode validates the specified mode.
Types ¶
type AttachStreams ¶
type AttachStreams struct { // OutputStream will be attached to container's STDOUT OutputStream io.Writer // ErrorStream will be attached to container's STDERR ErrorStream io.Writer // InputStream will be attached to container's STDIN InputStream *bufio.Reader // AttachOutput is whether to attach to STDOUT // If false, stdout will not be attached AttachOutput bool // AttachError is whether to attach to STDERR // If false, stdout will not be attached AttachError bool // AttachInput is whether to attach to STDIN // If false, stdout will not be attached AttachInput bool }
AttachStreams contains streams that will be attached to the container
type CRIUCheckpointRestoreStatistics ¶
type CRIUCheckpointRestoreStatistics struct { // Checkpoint values // Time required to freeze/pause/quiesce the processes FreezingTime uint32 `json:"freezing_time,omitempty"` // Time the processes are actually not running during checkpointing FrozenTime uint32 `json:"frozen_time,omitempty"` // Time required to extract memory pages from the processes MemdumpTime uint32 `json:"memdump_time,omitempty"` // Time required to write memory pages to disk MemwriteTime uint32 `json:"memwrite_time,omitempty"` // Number of memory pages CRIU analyzed PagesScanned uint64 `json:"pages_scanned,omitempty"` // Number of memory pages written PagesWritten uint64 `json:"pages_written,omitempty"` // Restore values // Number of pages compared during restore PagesCompared uint64 `json:"pages_compared,omitempty"` // Number of COW pages skipped during restore PagesSkippedCow uint64 `json:"pages_skipped_cow,omitempty"` // Time required to fork processes ForkingTime uint32 `json:"forking_time,omitempty"` // Time required to restore RestoreTime uint32 `json:"restore_time,omitempty"` // Number of memory pages restored PagesRestored uint64 `json:"pages_restored,omitempty"` }
This contains values reported by CRIU during checkpointing or restoring. All names are the same as reported by CRIU.
type ConmonInfo ¶
type ConmonInfo struct { Package string `json:"package"` Path string `json:"path"` Version string `json:"version"` }
ConmonInfo describes the conmon executable being used
type ContainerExecStatus ¶
type ContainerExecStatus int
ContainerExecStatus is the status of an exec session within a container.
const ( // ExecStateUnknown indicates that the state of the exec session is not // known. ExecStateUnknown ContainerExecStatus = iota // ExecStateCreated indicates that the exec session has been created but // not yet started ExecStateCreated ContainerExecStatus = iota // ExecStateRunning indicates that the exec session has been started but // has not yet exited. ExecStateRunning ContainerExecStatus = iota // ExecStateStopped indicates that the exec session has stopped and is // no longer running. ExecStateStopped ContainerExecStatus = iota )
func (ContainerExecStatus) String ¶
func (s ContainerExecStatus) String() string
String returns a string representation of a given exec state.
type ContainerNetworkStats ¶
type ContainerNetworkStats struct { RxBytes uint64 RxDropped uint64 RxErrors uint64 RxPackets uint64 TxBytes uint64 TxDropped uint64 TxErrors uint64 TxPackets uint64 }
Statistics for an individual container network interface
type ContainerStats ¶
type ContainerStats struct { AvgCPU float64 ContainerID string Name string PerCPU []uint64 CPU float64 CPUNano uint64 CPUSystemNano uint64 SystemNano uint64 MemUsage uint64 MemLimit uint64 MemPerc float64 // Map of interface name to network statistics for that interface. Network map[string]ContainerNetworkStats BlockInput uint64 BlockOutput uint64 PIDs uint64 UpTime time.Duration Duration uint64 }
ContainerStats contains the statistics information for a running container
type ContainerStatus ¶
type ContainerStatus int
ContainerStatus represents the current state of a container
const ( // ContainerStateUnknown indicates that the container is in an error // state where information about it cannot be retrieved ContainerStateUnknown ContainerStatus = iota // ContainerStateConfigured indicates that the container has had its // storage configured but it has not been created in the OCI runtime ContainerStateConfigured ContainerStatus = iota // ContainerStateCreated indicates the container has been created in // the OCI runtime but not started ContainerStateCreated ContainerStatus = iota // ContainerStateRunning indicates the container is currently executing ContainerStateRunning ContainerStatus = iota // ContainerStateStopped indicates that the container was running but has // exited ContainerStateStopped ContainerStatus = iota // ContainerStatePaused indicates that the container has been paused ContainerStatePaused ContainerStatus = iota // ContainerStateExited indicates the container has stopped and been // cleaned up ContainerStateExited ContainerStatus = iota // ContainerStateRemoving indicates the container is in the process of // being removed. ContainerStateRemoving ContainerStatus = iota // ContainerStateStopping indicates the container is in the process of // being stopped. ContainerStateStopping ContainerStatus = iota )
func StringToContainerStatus ¶
func StringToContainerStatus(status string) (ContainerStatus, error)
StringToContainerStatus converts a string representation of a container's status into an actual container status type
func (ContainerStatus) String ¶
func (t ContainerStatus) String() string
ContainerStatus returns a string representation for users of a container state. All results should match Docker's versions (from `docker ps`) as closely as possible, given the different set of states we support.
type ContainerStore ¶
type ContainerStore struct { Number int `json:"number"` Paused int `json:"paused"` Running int `json:"running"` Stopped int `json:"stopped"` }
ContainerStore describes the quantity of containers in the store by status
type DistributionInfo ¶
type DistributionInfo struct { Distribution string `json:"distribution"` Variant string `json:"variant,omitempty"` Version string `json:"version"` Codename string `json:"codename,omitempty"` }
DistributionInfo describes the host distribution for libpod
type DriverData ¶
DriverData handles the data for a storage driver
type FileInfo ¶
type FileInfo struct { Name string `json:"name"` Size int64 `json:"size"` Mode os.FileMode `json:"mode"` ModTime time.Time `json:"mtime"` IsDir bool `json:"isDir"` LinkTarget string `json:"linkTarget"` }
FileInfo describes the attributes of a file or directory.
type HealthCheckLog ¶
type HealthCheckLog struct { // Start time as string Start string `json:"Start"` // End time as a string End string `json:"End"` // Exitcode is 0 or 1 ExitCode int `json:"ExitCode"` // Output is the stdout/stderr from the healthcheck command Output string `json:"Output"` }
HealthCheckLog describes the results of a single healthcheck
type HealthCheckOnFailureAction ¶
type HealthCheckOnFailureAction int
HealthCheckOnFailureAction defines how Podman reacts when a container's health status turns unhealthy.
func ParseHealthCheckOnFailureAction ¶
func ParseHealthCheckOnFailureAction(s string) (HealthCheckOnFailureAction, error)
ParseHealthCheckOnFailureAction parses the specified string into a HealthCheckOnFailureAction. An error is returned for an invalid input.
func (HealthCheckOnFailureAction) String ¶
func (h HealthCheckOnFailureAction) String() string
String returns the string representation of the HealthCheckOnFailureAction.
type HealthCheckResults ¶
type HealthCheckResults struct { // Status starting, healthy or unhealthy Status string `json:"Status"` // FailingStreak is the number of consecutive failed healthchecks FailingStreak int `json:"FailingStreak"` // Log describes healthcheck attempts and results Log []HealthCheckLog `json:"Log"` }
HealthCheckResults describes the results/logs from a healthcheck
type HealthCheckStatus ¶
type HealthCheckStatus int
HealthCheckStatus represents the current state of a container
const ( // HealthCheckSuccess means the health worked HealthCheckSuccess HealthCheckStatus = iota // HealthCheckFailure means the health ran and failed HealthCheckFailure HealthCheckStatus = iota // HealthCheckContainerStopped means the health check cannot // be run because the container is stopped HealthCheckContainerStopped HealthCheckStatus = iota // HealthCheckContainerNotFound means the container could // not be found in local store HealthCheckContainerNotFound HealthCheckStatus = iota // HealthCheckNotDefined means the container has no health // check defined in it HealthCheckNotDefined HealthCheckStatus = iota // HealthCheckInternalError means some something failed obtaining or running // a given health check HealthCheckInternalError HealthCheckStatus = iota // HealthCheckDefined means the healthcheck was found on the container HealthCheckDefined HealthCheckStatus = iota // HealthCheckStartup means the healthcheck was unhealthy, but is still // either within the startup HC or the startup period of the healthcheck HealthCheckStartup HealthCheckStatus = iota )
type HostInfo ¶
type HostInfo struct { Arch string `json:"arch"` BuildahVersion string `json:"buildahVersion"` CgroupManager string `json:"cgroupManager"` CgroupsVersion string `json:"cgroupVersion"` CgroupControllers []string `json:"cgroupControllers"` Conmon *ConmonInfo `json:"conmon"` CPUs int `json:"cpus"` CPUUtilization *CPUUsage `json:"cpuUtilization"` DatabaseBackend string `json:"databaseBackend"` Distribution DistributionInfo `json:"distribution"` EventLogger string `json:"eventLogger"` FreeLocks *uint32 `json:"freeLocks,omitempty"` Hostname string `json:"hostname"` IDMappings IDMappings `json:"idMappings,omitempty"` Kernel string `json:"kernel"` LogDriver string `json:"logDriver"` MemFree int64 `json:"memFree"` MemTotal int64 `json:"memTotal"` NetworkBackend string `json:"networkBackend"` NetworkBackendInfo types.NetworkInfo `json:"networkBackendInfo"` OCIRuntime *OCIRuntimeInfo `json:"ociRuntime"` OS string `json:"os"` // RemoteSocket returns the UNIX domain socket the Podman service is listening on RemoteSocket *RemoteSocket `json:"remoteSocket,omitempty"` // RootlessNetworkCmd returns the default rootless network command (slirp4netns or pasta) RootlessNetworkCmd string `json:"rootlessNetworkCmd"` RuntimeInfo map[string]interface{} `json:"runtimeInfo,omitempty"` // ServiceIsRemote is true when the podman/libpod service is remote to the client ServiceIsRemote bool `json:"serviceIsRemote"` Security SecurityInfo `json:"security"` Slirp4NetNS SlirpInfo `json:"slirp4netns,omitempty"` Pasta PastaInfo `json:"pasta,omitempty"` SwapFree int64 `json:"swapFree"` SwapTotal int64 `json:"swapTotal"` Uptime string `json:"uptime"` Variant string `json:"variant"` Linkmode string `json:"linkmode"` }
HostInfo describes the libpod host
type IDMappings ¶
type IDMappings struct { GIDMap []idtools.IDMap `json:"gidmap"` UIDMap []idtools.IDMap `json:"uidmap"` }
IDMappings describe the GID and UID mappings
type ImageStore ¶
type ImageStore struct {
Number int `json:"number"`
}
ImageStore describes the image store. Right now only the number of images present
type Info ¶
type Info struct { Host *HostInfo `json:"host"` Store *StoreInfo `json:"store"` Registries map[string]interface{} `json:"registries"` Plugins Plugins `json:"plugins"` Version Version `json:"version"` }
Info is the overall struct that describes the host system running libpod/podman swagger:model LibpodInfo
type InspectAdditionalNetwork ¶
type InspectAdditionalNetwork struct { InspectBasicNetworkConfig // Name of the network we're connecting to. NetworkID string `json:"NetworkID,omitempty"` // DriverOpts is presently unused and maintained exclusively for // compatibility. DriverOpts map[string]string `json:"DriverOpts"` // IPAMConfig is presently unused and maintained exclusively for // compatibility. IPAMConfig map[string]string `json:"IPAMConfig"` // Links is presently unused and maintained exclusively for // compatibility. Links []string `json:"Links"` // Aliases are any network aliases the container has in this network. Aliases []string `json:"Aliases,omitempty"` }
InspectAdditionalNetwork holds information about non-default networks the container has been connected to. As with InspectNetworkSettings, many fields are unused and maintained only for compatibility with Docker.
type InspectBasicNetworkConfig ¶
type InspectBasicNetworkConfig struct { // EndpointID is unused, maintained exclusively for compatibility. EndpointID string `json:"EndpointID"` // Gateway is the IP address of the gateway this network will use. Gateway string `json:"Gateway"` // IPAddress is the IP address for this network. IPAddress string `json:"IPAddress"` // IPPrefixLen is the length of the subnet mask of this network. IPPrefixLen int `json:"IPPrefixLen"` // SecondaryIPAddresses is a list of extra IP Addresses that the // container has been assigned in this network. SecondaryIPAddresses []Address `json:"SecondaryIPAddresses,omitempty"` // IPv6Gateway is the IPv6 gateway this network will use. IPv6Gateway string `json:"IPv6Gateway"` // GlobalIPv6Address is the global-scope IPv6 Address for this network. GlobalIPv6Address string `json:"GlobalIPv6Address"` // GlobalIPv6PrefixLen is the length of the subnet mask of this network. GlobalIPv6PrefixLen int `json:"GlobalIPv6PrefixLen"` // SecondaryIPv6Addresses is a list of extra IPv6 Addresses that the // container has been assigned in this network. SecondaryIPv6Addresses []Address `json:"SecondaryIPv6Addresses,omitempty"` // MacAddress is the MAC address for the interface in this network. MacAddress string `json:"MacAddress"` // AdditionalMacAddresses is a set of additional MAC Addresses beyond // the first. CNI may configure more than one interface for a single // network, which can cause this. AdditionalMacAddresses []string `json:"AdditionalMACAddresses,omitempty"` }
InspectBasicNetworkConfig holds basic configuration information (e.g. IP addresses, MAC address, subnet masks, etc) that are common for all networks (both additional and main).
type InspectBlkioThrottleDevice ¶
type InspectBlkioThrottleDevice struct { // Path is the path to the device this applies to. Path string `json:"Path"` // Rate is the maximum rate. It is in either bytes per second or iops // per second, determined by where it is used - documentation will // indicate which is appropriate. Rate uint64 `json:"Rate"` }
InspectBlkioThrottleDevice holds information about a speed cap for a device node. This cap applies to a specific operation (read, write, etc) on the given node.
type InspectBlkioWeightDevice ¶
type InspectBlkioWeightDevice struct { // Path is the path to the device this applies to. Path string `json:"Path"` // Weight is the relative weight the scheduler will use when scheduling // I/O. Weight uint16 `json:"Weight"` }
InspectBlkioWeightDevice holds information about the relative weight of an individual device node. Weights are used in the I/O scheduler to give relative priority to some accesses.
type InspectContainerConfig ¶
type InspectContainerConfig struct { // Container hostname Hostname string `json:"Hostname"` // Container domain name - unused at present DomainName string `json:"Domainname"` // User the container was launched with User string `json:"User"` // Unused, at present AttachStdin bool `json:"AttachStdin"` // Unused, at present AttachStdout bool `json:"AttachStdout"` // Unused, at present AttachStderr bool `json:"AttachStderr"` // Whether the container creates a TTY Tty bool `json:"Tty"` // Whether the container leaves STDIN open OpenStdin bool `json:"OpenStdin"` // Whether STDIN is only left open once. // Presently not supported by Podman, unused. StdinOnce bool `json:"StdinOnce"` // Container environment variables Env []string `json:"Env"` // Container command Cmd []string `json:"Cmd"` // Container image Image string `json:"Image"` // Unused, at present. I've never seen this field populated. Volumes map[string]struct{} `json:"Volumes"` // Container working directory WorkingDir string `json:"WorkingDir"` // Container entrypoint Entrypoint []string `json:"Entrypoint"` // On-build arguments - presently unused. More of Buildah's domain. OnBuild *string `json:"OnBuild"` // Container labels Labels map[string]string `json:"Labels"` // Container annotations Annotations map[string]string `json:"Annotations"` // Container stop signal StopSignal string `json:"StopSignal"` // Configured startup healthcheck for the container StartupHealthCheck *StartupHealthCheck `json:"StartupHealthCheck,omitempty"` // Configured healthcheck for the container Healthcheck *manifest.Schema2HealthConfig `json:"Healthcheck,omitempty"` // HealthcheckOnFailureAction defines an action to take once the container turns unhealthy. HealthcheckOnFailureAction string `json:"HealthcheckOnFailureAction,omitempty"` // HealthLogDestination defines the destination where the log is stored HealthLogDestination string `json:"HealthLogDestination,omitempty"` // HealthMaxLogCount is maximum number of attempts in the HealthCheck log file. // ('0' value means an infinite number of attempts in the log file) HealthMaxLogCount uint `json:"HealthcheckMaxLogCount,omitempty"` // HealthMaxLogSize is the maximum length in characters of stored HealthCheck log // ("0" value means an infinite log length) HealthMaxLogSize uint `json:"HealthcheckMaxLogSize,omitempty"` // CreateCommand is the full command plus arguments of the process the // container has been created with. CreateCommand []string `json:"CreateCommand,omitempty"` // Timezone is the timezone inside the container. // Local means it has the same timezone as the host machine Timezone string `json:"Timezone,omitempty"` // SystemdMode is whether the container is running in systemd mode. In // systemd mode, the container configuration is customized to optimize // running systemd in the container. SystemdMode bool `json:"SystemdMode,omitempty"` // Umask is the umask inside the container. Umask string `json:"Umask,omitempty"` // Secrets are the secrets mounted in the container Secrets []*InspectSecret `json:"Secrets,omitempty"` // Timeout is time before container is killed by conmon Timeout uint `json:"Timeout"` // StopTimeout is time before container is stopped when calling stop StopTimeout uint `json:"StopTimeout"` // Passwd determines whether or not podman can add entries to /etc/passwd and /etc/group Passwd *bool `json:"Passwd,omitempty"` // ChrootDirs is an additional set of directories that need to be // treated as root directories. Standard bind mounts will be mounted // into paths relative to these directories. ChrootDirs []string `json:"ChrootDirs,omitempty"` // SdNotifyMode is the sd-notify mode of the container. SdNotifyMode string `json:"sdNotifyMode,omitempty"` // SdNotifySocket is the NOTIFY_SOCKET in use by/configured for the container. SdNotifySocket string `json:"sdNotifySocket,omitempty"` // ExposedPorts includes ports the container has exposed. ExposedPorts map[string]struct{} `json:"ExposedPorts,omitempty"` // V4PodmanCompatMarshal indicates that the json marshaller should // use the old v4 inspect format to keep API compatibility. V4PodmanCompatMarshal bool `json:"-"` }
InspectContainerConfig holds further data about how a container was initially configured.
func (*InspectContainerConfig) MarshalJSON ¶ added in v5.1.0
func (insp *InspectContainerConfig) MarshalJSON() ([]byte, error)
func (*InspectContainerConfig) UnmarshalJSON ¶
func (insp *InspectContainerConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON allow compatibility with podman V4 API
type InspectContainerData ¶
type InspectContainerData struct { ID string `json:"Id"` Created time.Time `json:"Created"` Path string `json:"Path"` Args []string `json:"Args"` State *InspectContainerState `json:"State"` Image string `json:"Image"` ImageDigest string `json:"ImageDigest"` ImageName string `json:"ImageName"` Rootfs string `json:"Rootfs"` Pod string `json:"Pod"` ResolvConfPath string `json:"ResolvConfPath"` HostnamePath string `json:"HostnamePath"` HostsPath string `json:"HostsPath"` StaticDir string `json:"StaticDir"` OCIConfigPath string `json:"OCIConfigPath,omitempty"` OCIRuntime string `json:"OCIRuntime,omitempty"` ConmonPidFile string `json:"ConmonPidFile"` PidFile string `json:"PidFile"` Name string `json:"Name"` RestartCount int32 `json:"RestartCount"` Driver string `json:"Driver"` MountLabel string `json:"MountLabel"` ProcessLabel string `json:"ProcessLabel"` AppArmorProfile string `json:"AppArmorProfile"` EffectiveCaps []string `json:"EffectiveCaps"` BoundingCaps []string `json:"BoundingCaps"` ExecIDs []string `json:"ExecIDs"` GraphDriver *DriverData `json:"GraphDriver"` SizeRw *int64 `json:"SizeRw,omitempty"` SizeRootFs int64 `json:"SizeRootFs,omitempty"` Mounts []InspectMount `json:"Mounts"` Dependencies []string `json:"Dependencies"` NetworkSettings *InspectNetworkSettings `json:"NetworkSettings"` Namespace string `json:"Namespace"` IsInfra bool `json:"IsInfra"` IsService bool `json:"IsService"` KubeExitCodePropagation string `json:"KubeExitCodePropagation"` LockNumber uint32 `json:"lockNumber"` Config *InspectContainerConfig `json:"Config"` HostConfig *InspectContainerHostConfig `json:"HostConfig"` }
InspectContainerData provides a detailed record of a container's configuration and state as viewed by Libpod. Large portions of this structure are defined such that the output is compatible with `docker inspect` JSON, but additional fields have been added as required to share information not in the original output.
type InspectContainerHostConfig ¶
type InspectContainerHostConfig struct { // Binds contains an array of user-added mounts. // Both volume mounts and named volumes are included. // Tmpfs mounts are NOT included. // In 'docker inspect' this is separated into 'Binds' and 'Mounts' based // on how a mount was added. We do not make this distinction and do not // include a Mounts field in inspect. // Format: <src>:<destination>[:<comma-separated options>] Binds []string `json:"Binds"` // CgroupManager is the cgroup manager used by the container. // At present, allowed values are either "cgroupfs" or "systemd". CgroupManager string `json:"CgroupManager,omitempty"` // CgroupMode is the configuration of the container's cgroup namespace. // Populated as follows: // private - a cgroup namespace has been created // host - No cgroup namespace created // container:<id> - Using another container's cgroup namespace // ns:<path> - A path to a cgroup namespace has been specified CgroupMode string `json:"CgroupMode"` // ContainerIDFile is a file created during container creation to hold // the ID of the created container. // This is not handled within libpod and is stored in an annotation. ContainerIDFile string `json:"ContainerIDFile"` // LogConfig contains information on the container's logging backend LogConfig *InspectLogConfig `json:"LogConfig"` // NetworkMode is the configuration of the container's network // namespace. // Populated as follows: // default - A network namespace is being created and configured via CNI // none - A network namespace is being created, not configured via CNI // host - No network namespace created // container:<id> - Using another container's network namespace // ns:<path> - A path to a network namespace has been specified NetworkMode string `json:"NetworkMode"` // PortBindings contains the container's port bindings. // It is formatted as map[string][]InspectHostPort. // The string key here is formatted as <integer port number>/<protocol> // and represents the container port. A single container port may be // bound to multiple host ports (on different IPs). PortBindings map[string][]InspectHostPort `json:"PortBindings"` // RestartPolicy contains the container's restart policy. RestartPolicy *InspectRestartPolicy `json:"RestartPolicy"` // AutoRemove is whether the container will be automatically removed on // exiting. // It is not handled directly within libpod and is stored in an // annotation. AutoRemove bool `json:"AutoRemove"` // AutoRemoveImage is whether the container's image will be // automatically removed on exiting. // It is not handled directly within libpod and is stored in an // annotation. AutoRemoveImage bool `json:"AutoRemoveImage"` // Annotations are provided to the runtime when the container is // started. Annotations map[string]string `json:"Annotations"` // VolumeDriver is presently unused and is retained for Docker // compatibility. VolumeDriver string `json:"VolumeDriver"` // VolumesFrom is a list of containers which this container uses volumes // from. This is not handled directly within libpod and is stored in an // annotation. // It is formatted as an array of container names and IDs. VolumesFrom []string `json:"VolumesFrom"` // CapAdd is a list of capabilities added to the container. // It is not directly stored by Libpod, and instead computed from the // capabilities listed in the container's spec, compared against a set // of default capabilities. CapAdd []string `json:"CapAdd"` // CapDrop is a list of capabilities removed from the container. // It is not directly stored by libpod, and instead computed from the // capabilities listed in the container's spec, compared against a set // of default capabilities. CapDrop []string `json:"CapDrop"` // Dns is a list of DNS nameservers that will be added to the // container's resolv.conf Dns []string `json:"Dns"` // DnsOptions is a list of DNS options that will be set in the // container's resolv.conf DnsOptions []string `json:"DnsOptions"` // DnsSearch is a list of DNS search domains that will be set in the // container's resolv.conf DnsSearch []string `json:"DnsSearch"` // ExtraHosts contains hosts that will be added to the container's // /etc/hosts. ExtraHosts []string `json:"ExtraHosts"` // GroupAdd contains groups that the user inside the container will be // added to. GroupAdd []string `json:"GroupAdd"` // IpcMode represents the configuration of the container's IPC // namespace. // Populated as follows: // "" (empty string) - Default, an IPC namespace will be created // host - No IPC namespace created // container:<id> - Using another container's IPC namespace // ns:<path> - A path to an IPC namespace has been specified IpcMode string `json:"IpcMode"` // Cgroup contains the container's cgroup. It is presently not // populated. // TODO. Cgroup string `json:"Cgroup"` // Cgroups contains the container's Cgroup mode. // Allowed values are "default" (container is creating Cgroups) and // "disabled" (container is not creating Cgroups). // This is Libpod-specific and not included in `docker inspect`. Cgroups string `json:"Cgroups"` // Links is unused, and provided purely for Docker compatibility. Links []string `json:"Links"` // OOMScoreAdj is an adjustment that will be made to the container's OOM // score. OomScoreAdj int `json:"OomScoreAdj"` // PidMode represents the configuration of the container's PID // namespace. // Populated as follows: // "" (empty string) - Default, a PID namespace will be created // host - No PID namespace created // container:<id> - Using another container's PID namespace // ns:<path> - A path to a PID namespace has been specified PidMode string `json:"PidMode"` // Privileged indicates whether the container is running with elevated // privileges. // This has a very specific meaning in the Docker sense, so it's very // difficult to decode from the spec and config, and so is stored as an // annotation. Privileged bool `json:"Privileged"` // PublishAllPorts indicates whether image ports are being published. // This is not directly stored in libpod and is saved as an annotation. PublishAllPorts bool `json:"PublishAllPorts"` // ReadonlyRootfs is whether the container will be mounted read-only. ReadonlyRootfs bool `json:"ReadonlyRootfs"` // SecurityOpt is a list of security-related options that are set in the // container. SecurityOpt []string `json:"SecurityOpt"` // Tmpfs is a list of tmpfs filesystems that will be mounted into the // container. // It is a map of destination path to options for the mount. Tmpfs map[string]string `json:"Tmpfs"` // UTSMode represents the configuration of the container's UID // namespace. // Populated as follows: // "" (empty string) - Default, a UTS namespace will be created // host - no UTS namespace created // container:<id> - Using another container's UTS namespace // ns:<path> - A path to a UTS namespace has been specified UTSMode string `json:"UTSMode"` // UsernsMode represents the configuration of the container's user // namespace. // When running rootless, a user namespace is created outside of libpod // to allow some privileged operations. This will not be reflected here. // Populated as follows: // "" (empty string) - No user namespace will be created // private - The container will be run in a user namespace // container:<id> - Using another container's user namespace // ns:<path> - A path to a user namespace has been specified // TODO Rootless has an additional 'keep-id' option, presently not // reflected here. UsernsMode string `json:"UsernsMode"` // IDMappings is the UIDMapping and GIDMapping used within the container IDMappings *InspectIDMappings `json:"IDMappings,omitempty"` ShmSize int64 `json:"ShmSize"` // Runtime is provided purely for Docker compatibility. // It is set unconditionally to "oci" as Podman does not presently // support non-OCI runtimes. Runtime string `json:"Runtime"` // ConsoleSize is an array of 2 integers showing the size of the // container's console. // It is only set if the container is creating a terminal. // TODO. ConsoleSize []uint `json:"ConsoleSize"` // Isolation is presently unused and provided solely for Docker // compatibility. Isolation string `json:"Isolation"` // It is a relative weight in the scheduler for assigning CPU time // versus other Cgroups. CpuShares uint64 `json:"CpuShares"` // Memory indicates the memory resources allocated to the container. // This is the limit (in bytes) of RAM the container may use. Memory int64 `json:"Memory"` // NanoCpus indicates number of CPUs allocated to the container. // It is an integer where one full CPU is indicated by 1000000000 (one // billion). // Thus, 2.5 CPUs (fractional portions of CPUs are allowed) would be // 2500000000 (2.5 billion). // In 'docker inspect' this is set exclusively of two further options in // the output (CpuPeriod and CpuQuota) which are both used to implement // this functionality. // We can't distinguish here, so if CpuQuota is set to the default of // 100000, we will set both CpuQuota, CpuPeriod, and NanoCpus. If // CpuQuota is not the default, we will not set NanoCpus. NanoCpus int64 `json:"NanoCpus"` // CgroupParent is the Cgroup parent of the container. // Only set if not default. CgroupParent string `json:"CgroupParent"` // BlkioWeight indicates the I/O resources allocated to the container. // It is a relative weight in the scheduler for assigning I/O time // versus other Cgroups. BlkioWeight uint16 `json:"BlkioWeight"` // BlkioWeightDevice is an array of I/O resource priorities for // individual device nodes. // Unfortunately, the spec only stores the device's Major/Minor numbers // and not the path, which is used here. // Fortunately, the kernel provides an interface for retrieving the path // of a given node by major:minor at /sys/dev/. However, the exact path // in use may not be what was used in the original CLI invocation - // though it is guaranteed that the device node will be the same, and // using the given path will be functionally identical. BlkioWeightDevice []InspectBlkioWeightDevice `json:"BlkioWeightDevice"` // BlkioDeviceReadBps is an array of I/O throttle parameters for // individual device nodes. // This specifically sets read rate cap in bytes per second for device // nodes. // As with BlkioWeightDevice, we pull the path from /sys/dev, and we // don't guarantee the path will be identical to the original (though // the node will be). BlkioDeviceReadBps []InspectBlkioThrottleDevice `json:"BlkioDeviceReadBps"` // BlkioDeviceWriteBps is an array of I/O throttle parameters for // individual device nodes. // this specifically sets write rate cap in bytes per second for device // nodes. // as with BlkioWeightDevice, we pull the path from /sys/dev, and we // don't guarantee the path will be identical to the original (though // the node will be). BlkioDeviceWriteBps []InspectBlkioThrottleDevice `json:"BlkioDeviceWriteBps"` // BlkioDeviceReadIOps is an array of I/O throttle parameters for // individual device nodes. // This specifically sets the read rate cap in iops per second for // device nodes. // As with BlkioWeightDevice, we pull the path from /sys/dev, and we // don't guarantee the path will be identical to the original (though // the node will be). BlkioDeviceReadIOps []InspectBlkioThrottleDevice `json:"BlkioDeviceReadIOps"` // BlkioDeviceWriteIOps is an array of I/O throttle parameters for // individual device nodes. // This specifically sets the write rate cap in iops per second for // device nodes. // As with BlkioWeightDevice, we pull the path from /sys/dev, and we // don't guarantee the path will be identical to the original (though // the node will be). BlkioDeviceWriteIOps []InspectBlkioThrottleDevice `json:"BlkioDeviceWriteIOps"` // CpuPeriod is the length of a CPU period in microseconds. // It relates directly to CpuQuota. CpuPeriod uint64 `json:"CpuPeriod"` // CpuPeriod is the amount of time (in microseconds) that a container // can use the CPU in every CpuPeriod. CpuQuota int64 `json:"CpuQuota"` // CpuRealtimePeriod is the length of time (in microseconds) of the CPU // realtime period. If set to 0, no time will be allocated to realtime // tasks. CpuRealtimePeriod uint64 `json:"CpuRealtimePeriod"` // CpuRealtimeRuntime is the length of time (in microseconds) allocated // for realtime tasks within every CpuRealtimePeriod. CpuRealtimeRuntime int64 `json:"CpuRealtimeRuntime"` // CpusetCpus is the set of CPUs that the container will execute on. // Formatted as `0-3` or `0,2`. Default (if unset) is all CPUs. CpusetCpus string `json:"CpusetCpus"` // CpusetMems is the set of memory nodes the container will use. // Formatted as `0-3` or `0,2`. Default (if unset) is all memory nodes. CpusetMems string `json:"CpusetMems"` // Devices is a list of device nodes that will be added to the // container. // These are stored in the OCI spec only as type, major, minor while we // display the host path. We convert this with /sys/dev, but we cannot // guarantee that the host path will be identical - only that the actual // device will be. Devices []InspectDevice `json:"Devices"` // DiskQuota is the maximum amount of disk space the container may use // (in bytes). // Presently not populated. // TODO. DiskQuota uint64 `json:"DiskQuota"` // KernelMemory is the maximum amount of memory the kernel will devote // to the container. KernelMemory int64 `json:"KernelMemory"` // MemoryReservation is the reservation (soft limit) of memory available // to the container. Soft limits are warnings only and can be exceeded. MemoryReservation int64 `json:"MemoryReservation"` // MemorySwap is the total limit for all memory available to the // container, including swap. 0 indicates that there is no limit to the // amount of memory available. MemorySwap int64 `json:"MemorySwap"` // MemorySwappiness is the willingness of the kernel to page container // memory to swap. It is an integer from 0 to 100, with low numbers // being more likely to be put into swap. // -1, the default, will not set swappiness and use the system defaults. MemorySwappiness int64 `json:"MemorySwappiness"` // OomKillDisable indicates whether the kernel OOM killer is disabled // for the container. OomKillDisable bool `json:"OomKillDisable"` // Init indicates whether the container has an init mounted into it. Init bool `json:"Init,omitempty"` // PidsLimit is the maximum number of PIDs that may be created within // the container. 0, the default, indicates no limit. PidsLimit int64 `json:"PidsLimit"` // Ulimits is a set of ulimits that will be set within the container. Ulimits []InspectUlimit `json:"Ulimits"` // CpuCount is Windows-only and not presently implemented. CpuCount uint64 `json:"CpuCount"` // CpuPercent is Windows-only and not presently implemented. CpuPercent uint64 `json:"CpuPercent"` // IOMaximumIOps is Windows-only and not presently implemented. IOMaximumIOps uint64 `json:"IOMaximumIOps"` // IOMaximumBandwidth is Windows-only and not presently implemented. IOMaximumBandwidth uint64 `json:"IOMaximumBandwidth"` // CgroupConf is the configuration for cgroup v2. CgroupConf map[string]string `json:"CgroupConf"` // IntelRdtClosID defines the Intel RDT CAT Class Of Service (COS) that // all processes of the container should run in. IntelRdtClosID string `json:"IntelRdtClosID,omitempty"` }
InspectContainerHostConfig holds information used when the container was created. It's very much a Docker-specific struct, retained (mostly) as-is for compatibility. We fill individual fields as best as we can, inferring as much as possible from the spec and container config. Some things cannot be inferred. These will be populated by spec annotations (if available).
type InspectContainerState ¶
type InspectContainerState struct { OciVersion string `json:"OciVersion"` Status string `json:"Status"` Running bool `json:"Running"` Paused bool `json:"Paused"` Restarting bool `json:"Restarting"` // TODO OOMKilled bool `json:"OOMKilled"` Dead bool `json:"Dead"` Pid int `json:"Pid"` ConmonPid int `json:"ConmonPid,omitempty"` ExitCode int32 `json:"ExitCode"` Error string `json:"Error"` // TODO StartedAt time.Time `json:"StartedAt"` FinishedAt time.Time `json:"FinishedAt"` Health *HealthCheckResults `json:"Health,omitempty"` Checkpointed bool `json:"Checkpointed,omitempty"` CgroupPath string `json:"CgroupPath,omitempty"` CheckpointedAt time.Time `json:"CheckpointedAt,omitempty"` RestoredAt time.Time `json:"RestoredAt,omitempty"` CheckpointLog string `json:"CheckpointLog,omitempty"` CheckpointPath string `json:"CheckpointPath,omitempty"` RestoreLog string `json:"RestoreLog,omitempty"` Restored bool `json:"Restored,omitempty"` StoppedByUser bool `json:"StoppedByUser,omitempty"` }
InspectContainerState provides a detailed record of a container's current state. It is returned as part of InspectContainerData. As with InspectContainerData, many portions of this struct are matched to Docker, but here we see more fields that are unused (nonsensical in the context of Libpod).
func (*InspectContainerState) Healthcheck ¶
func (s *InspectContainerState) Healthcheck() *HealthCheckResults
Healthcheck returns the HealthCheckResults. This is used for old podman compat to make the "Healthcheck" key available in the go template.
type InspectDevice ¶
type InspectDevice struct { // PathOnHost is the path of the device on the host. PathOnHost string `json:"PathOnHost"` // PathInContainer is the path of the device within the container. PathInContainer string `json:"PathInContainer"` // CgroupPermissions is the permissions of the mounted device. // Presently not populated. // TODO. CgroupPermissions string `json:"CgroupPermissions"` }
InspectDevice is a single device that will be mounted into the container.
type InspectExecProcess ¶
type InspectExecProcess struct { // Arguments are the arguments to the entrypoint command of the exec // session. Arguments []string `json:"arguments"` // Entrypoint is the entrypoint for the exec session (the command that // will be executed in the container). Entrypoint string `json:"entrypoint"` // Privileged is whether the exec session will be started with elevated // privileges. Privileged bool `json:"privileged"` // Tty is whether the exec session created a terminal. Tty bool `json:"tty"` // User is the user the exec session was started as. User string `json:"user"` }
InspectExecProcess contains information about the process in a given exec session.
type InspectExecSession ¶
type InspectExecSession struct { // CanRemove is legacy and used purely for compatibility reasons. // Will always be set to true, unless the exec session is running. CanRemove bool `json:"CanRemove"` // ContainerID is the ID of the container this exec session is attached // to. ContainerID string `json:"ContainerID"` // DetachKeys are the detach keys used by the exec session. // If set to "" the default keys are being used. // Will show "<none>" if no detach keys are set. DetachKeys string `json:"DetachKeys"` // ExitCode is the exit code of the exec session. Will be set to 0 if // the exec session has not yet exited. ExitCode int `json:"ExitCode"` // ID is the ID of the exec session. ID string `json:"ID"` // OpenStderr is whether the container's STDERR stream will be attached. // Always set to true if the exec session created a TTY. OpenStderr bool `json:"OpenStderr"` // OpenStdin is whether the container's STDIN stream will be attached // to. OpenStdin bool `json:"OpenStdin"` // OpenStdout is whether the container's STDOUT stream will be attached. // Always set to true if the exec session created a TTY. OpenStdout bool `json:"OpenStdout"` // Running is whether the exec session is running. Running bool `json:"Running"` // Pid is the PID of the exec session's process. // Will be set to 0 if the exec session is not running. Pid int `json:"Pid"` // ProcessConfig contains information about the exec session's process. ProcessConfig *InspectExecProcess `json:"ProcessConfig"` }
InspectExecSession contains information about a given exec session.
type InspectHostPort ¶
type InspectHostPort struct { // IP on the host we are bound to. "" if not specified (binding to all // IPs). HostIP string `json:"HostIp"` // Port on the host we are bound to. No special formatting - just an // integer stuffed into a string. HostPort string `json:"HostPort"` }
InspectHostPort provides information on a port on the host that a container's port is bound to.
type InspectIDMappings ¶
type InspectLogConfig ¶
type InspectLogConfig struct { Type string `json:"Type"` Config map[string]string `json:"Config"` // Path specifies a path to the log file Path string `json:"Path"` // Tag specifies a custom log tag for the container Tag string `json:"Tag"` // Size specifies a maximum size of the container log Size string `json:"Size"` }
InspectLogConfig holds information about a container's configured log driver
type InspectMount ¶
type InspectMount struct { // Whether the mount is a volume or bind mount. Allowed values are // "volume" and "bind". Type string `json:"Type"` // The name of the volume. Empty for bind mounts. Name string `json:"Name,omitempty"` // The source directory for the volume. Source string `json:"Source"` // The destination directory for the volume. Specified as a path within // the container, as it would be passed into the OCI runtime. Destination string `json:"Destination"` // The driver used for the named volume. Empty for bind mounts. Driver string `json:"Driver"` // Contains SELinux :z/:Z mount options. Unclear what, if anything, else // goes in here. Mode string `json:"Mode"` // All remaining mount options. Additional data, not present in the // original output. Options []string `json:"Options"` // Whether the volume is read-write RW bool `json:"RW"` // Mount propagation for the mount. Can be empty if not specified, but // is always printed - no omitempty. Propagation string `json:"Propagation"` // SubPath object from the volume. Specified as a path within // the source volume to be mounted at the Destination. SubPath string `json:"SubPath,omitempty"` }
InspectMount provides a record of a single mount in a container. It contains fields for both named and normal volumes. Only user-specified volumes will be included, and tmpfs volumes are not included even if the user specified them.
type InspectNetworkSettings ¶
type InspectNetworkSettings struct { InspectBasicNetworkConfig Bridge string `json:"Bridge"` SandboxID string `json:"SandboxID"` HairpinMode bool `json:"HairpinMode"` LinkLocalIPv6Address string `json:"LinkLocalIPv6Address"` LinkLocalIPv6PrefixLen int `json:"LinkLocalIPv6PrefixLen"` Ports map[string][]InspectHostPort `json:"Ports"` SandboxKey string `json:"SandboxKey"` // Networks contains information on non-default networks this // container has joined. // It is a map of network name to network information. Networks map[string]*InspectAdditionalNetwork `json:"Networks,omitempty"` }
InspectNetworkSettings holds information about the network settings of the container. Many fields are maintained only for compatibility with `docker inspect` and are unused within Libpod.
type InspectPodContainerInfo ¶
type InspectPodContainerInfo struct { // ID is the ID of the container. ID string `json:"Id"` // Name is the name of the container. Name string // State is the current status of the container. State string }
InspectPodContainerInfo contains information on a container in a pod.
type InspectPodData ¶
type InspectPodData struct { // ID is the ID of the pod. ID string `json:"Id"` // Name is the name of the pod. Name string // Namespace is the Libpod namespace the pod is placed in. Namespace string `json:"Namespace,omitempty"` // Created is the time when the pod was created. Created time.Time // CreateCommand is the full command plus arguments of the process the // container has been created with. CreateCommand []string `json:"CreateCommand,omitempty"` // ExitPolicy of the pod. ExitPolicy string `json:"ExitPolicy,omitempty"` // State represents the current state of the pod. State string `json:"State"` // Hostname is the hostname that the pod will set. Hostname string // Labels is a set of key-value labels that have been applied to the // pod. Labels map[string]string `json:"Labels,omitempty"` // CreateCgroup is whether this pod will create its own Cgroup to group // containers under. CreateCgroup bool // CgroupParent is the parent of the pod's Cgroup. CgroupParent string `json:"CgroupParent,omitempty"` // CgroupPath is the path to the pod's Cgroup. CgroupPath string `json:"CgroupPath,omitempty"` // CreateInfra is whether this pod will create an infra container to // share namespaces. CreateInfra bool // InfraContainerID is the ID of the pod's infra container, if one is // present. InfraContainerID string `json:"InfraContainerID,omitempty"` // InfraConfig is the configuration of the infra container of the pod. // Will only be set if CreateInfra is true. InfraConfig *InspectPodInfraConfig `json:"InfraConfig,omitempty"` // containers within the pod. Can only be set if CreateInfra is true. SharedNamespaces []string `json:"SharedNamespaces,omitempty"` // NumContainers is the number of containers in the pod, including the // infra container. NumContainers uint // Containers gives a brief summary of all containers in the pod and // their current status. Containers []InspectPodContainerInfo `json:"Containers,omitempty"` // CPUPeriod contains the CPU period of the pod CPUPeriod uint64 `json:"cpu_period,omitempty"` // CPUQuota contains the CPU quota of the pod CPUQuota int64 `json:"cpu_quota,omitempty"` CPUShares uint64 `json:"cpu_shares,omitempty"` // CPUSetCPUs contains linux specific CPU data for the pod CPUSetCPUs string `json:"cpuset_cpus,omitempty"` // CPUSetMems contains linux specific CPU data for the pod CPUSetMems string `json:"cpuset_mems,omitempty"` // Mounts contains volume related information for the pod Mounts []InspectMount `json:"mounts,omitempty"` // Devices contains the specified host devices Devices []InspectDevice `json:"devices,omitempty"` // BlkioDeviceReadBps contains the Read/Access limit for the pod's devices BlkioDeviceReadBps []InspectBlkioThrottleDevice `json:"device_read_bps,omitempty"` // BlkioDeviceReadBps contains the Read/Access limit for the pod's devices BlkioDeviceWriteBps []InspectBlkioThrottleDevice `json:"device_write_bps,omitempty"` // VolumesFrom contains the containers that the pod inherits mounts from VolumesFrom []string `json:"volumes_from,omitempty"` // SecurityOpt contains the specified security labels and related SELinux information SecurityOpts []string `json:"security_opt,omitempty"` // MemoryLimit contains the specified cgroup memory limit for the pod MemoryLimit uint64 `json:"memory_limit,omitempty"` // MemorySwap contains the specified memory swap limit for the pod MemorySwap uint64 `json:"memory_swap,omitempty"` // BlkioWeight contains the blkio weight limit for the pod BlkioWeight uint64 `json:"blkio_weight,omitempty"` // BlkioWeightDevice contains the blkio weight device limits for the pod BlkioWeightDevice []InspectBlkioWeightDevice `json:"blkio_weight_device,omitempty"` // RestartPolicy of the pod. RestartPolicy string `json:"RestartPolicy,omitempty"` // Number of the pod's Libpod lock. LockNumber uint32 }
InspectPodData contains detailed information on a pod's configuration and state. It is used as the output of Inspect on pods.
type InspectPodInfraConfig ¶
type InspectPodInfraConfig struct { // PortBindings are ports that will be forwarded to the infra container // and then shared with the pod. PortBindings map[string][]InspectHostPort // HostNetwork is whether the infra container (and thus the whole pod) // will use the host's network and not create a network namespace. HostNetwork bool // StaticIP is a static IPv4 that will be assigned to the infra // container and then used by the pod. // swagger:strfmt ipv4 StaticIP net.IP // StaticMAC is a static MAC address that will be assigned to the infra // container and then used by the pod. StaticMAC string // NoManageResolvConf indicates that the pod will not manage resolv.conf // and instead each container will handle their own. NoManageResolvConf bool // DNSServer is a set of DNS Servers that will be used by the infra // container's resolv.conf and shared with the remainder of the pod. DNSServer []string // DNSSearch is a set of DNS search domains that will be used by the // infra container's resolv.conf and shared with the remainder of the // pod. DNSSearch []string // DNSOption is a set of DNS options that will be used by the infra // container's resolv.conf and shared with the remainder of the pod. DNSOption []string // NoManageHosts indicates that the pod will not manage /etc/hosts and // instead each container will handle their own. NoManageHosts bool // HostAdd adds a number of hosts to the infra container's resolv.conf // which will be shared with the rest of the pod. HostAdd []string // Networks is a list of networks the pod will join. Networks []string // NetworkOptions are additional options for each network NetworkOptions map[string][]string // CPUPeriod contains the CPU period of the pod CPUPeriod uint64 `json:"cpu_period,omitempty"` // CPUQuota contains the CPU quota of the pod CPUQuota int64 `json:"cpu_quota,omitempty"` // CPUSetCPUs contains linux specific CPU data for the container CPUSetCPUs string `json:"cpuset_cpus,omitempty"` // Pid is the PID namespace mode of the pod's infra container PidNS string `json:"pid_ns,omitempty"` // UserNS is the usernamespace that all the containers in the pod will join. UserNS string `json:"userns,omitempty"` // UtsNS is the uts namespace that all containers in the pod will join UtsNS string `json:"uts_ns,omitempty"` }
InspectPodInfraConfig contains the configuration of the pod's infra container.
type InspectRestartPolicy ¶
type InspectRestartPolicy struct { // Name contains the container's restart policy. // Allowable values are "no" or "" (take no action), // "on-failure" (restart on non-zero exit code, with an optional max // retry count), and "always" (always restart on container stop, unless // explicitly requested by API). // Note that this is NOT actually a name of any sort - the poor naming // is for Docker compatibility. Name string `json:"Name"` // MaximumRetryCount is the maximum number of retries allowed if the // "on-failure" restart policy is in use. Not used if "on-failure" is // not set. MaximumRetryCount uint `json:"MaximumRetryCount"` }
InspectRestartPolicy holds information about the container's restart policy.
type InspectSecret ¶
type InspectSecret struct { // Name is the name of the secret Name string `json:"Name"` // ID is the ID of the secret ID string `json:"ID"` // ID is the UID of the mounted secret file UID uint32 `json:"UID"` // ID is the GID of the mounted secret file GID uint32 `json:"GID"` // ID is the ID of the mode of the mounted secret file Mode uint32 `json:"Mode"` }
InspectSecret contains information on secrets mounted inside the container
type InspectUlimit ¶
type InspectUlimit struct { // Name is the name (type) of the ulimit. Name string `json:"Name"` // Soft is the soft limit that will be applied. Soft int64 `json:"Soft"` // Hard is the hard limit that will be applied. Hard int64 `json:"Hard"` }
InspectUlimit is a ulimit that will be applied to the container.
type InspectVolumeData ¶
type InspectVolumeData struct { // Name is the name of the volume. Name string `json:"Name"` // Driver is the driver used to create the volume. // If set to "local" or "", the Local driver (Podman built-in code) is // used to service the volume; otherwise, a volume plugin with the given // name is used to mount and manage the volume. Driver string `json:"Driver"` // Mountpoint is the path on the host where the volume is mounted. Mountpoint string `json:"Mountpoint"` // CreatedAt is the date and time the volume was created at. This is not // stored for older Libpod volumes; if so, it will be omitted. CreatedAt time.Time `json:"CreatedAt,omitempty"` // Status is used to return information on the volume's current state, // if the volume was created using a volume plugin (uses a Driver that // is not the local driver). // Status is provided to us by an external program, so no guarantees are // made about its format or contents. Further, it is an optional field, // so it may not be set even in cases where a volume plugin is in use. Status map[string]interface{} `json:"Status,omitempty"` // Labels includes the volume's configured labels, key:value pairs that // can be passed during volume creation to provide information for third // party tools. Labels map[string]string `json:"Labels"` // Scope is unused and provided solely for Docker compatibility. It is // unconditionally set to "local". Scope string `json:"Scope"` // Options is a set of options that were used when creating the volume. // For the Local driver, these are mount options that will be used to // determine how a local filesystem is mounted; they are handled as // parameters to Mount in a manner described in the volume create // manpage. // For non-local drivers, these are passed as-is to the volume plugin. Options map[string]string `json:"Options"` // UID is the UID that the volume was created with. UID int `json:"UID,omitempty"` // GID is the GID that the volume was created with. GID int `json:"GID,omitempty"` // Anonymous indicates that the volume was created as an anonymous // volume for a specific container, and will be removed when any // container using it is removed. Anonymous bool `json:"Anonymous,omitempty"` // MountCount is the number of times this volume has been mounted. MountCount uint `json:"MountCount"` // NeedsCopyUp indicates that the next time the volume is mounted into NeedsCopyUp bool `json:"NeedsCopyUp,omitempty"` // NeedsChown indicates that the next time the volume is mounted into // a container, the container will chown the volume to the container process // UID/GID. NeedsChown bool `json:"NeedsChown,omitempty"` // Timeout is the specified driver timeout if given Timeout uint `json:"Timeout,omitempty"` // StorageID is the ID of the container backing the volume in c/storage. // Only used with Image Volumes. StorageID string `json:"StorageID,omitempty"` // LockNumber is the number of the volume's Libpod lock. LockNumber uint32 }
InspectVolumeData is the output of Inspect() on a volume. It is matched to the format of 'docker volume inspect'.
type KubeExitCodePropagation ¶
type KubeExitCodePropagation int
KubeExitCodePropagation defines an exit policy of kube workloads.
const ( // Invalid exit policy for a proper type system. KubeExitCodePropagationInvalid KubeExitCodePropagation = iota // Exit 0 regardless of any failed containers. KubeExitCodePropagationNone // Exit non-zero if all containers failed. KubeExitCodePropagationAll // Exit non-zero if any container failed. KubeExitCodePropagationAny )
func ParseKubeExitCodePropagation ¶
func ParseKubeExitCodePropagation(value string) (KubeExitCodePropagation, error)
Parse the specified kube exit-code propagation. Return an error if an unsupported value is specified.
func (KubeExitCodePropagation) String ¶
func (k KubeExitCodePropagation) String() string
Return the string representation of the KubeExitCodePropagation.
type OCIRuntimeInfo ¶
type OCIRuntimeInfo struct { Name string `json:"name"` Package string `json:"package"` Path string `json:"path"` Version string `json:"version"` }
OCIRuntimeInfo describes the runtime (crun or runc) being used with podman
type PastaInfo ¶
type PastaInfo struct { Executable string `json:"executable"` Package string `json:"package"` Version string `json:"version"` }
PastaInfo describes the pasta executable that is being used
type RemoteSocket ¶
RemoteSocket describes information about the API socket
type RuntimeStateStore ¶
type RuntimeStateStore int
RuntimeStateStore is a constant indicating which state store implementation should be used by libpod
const ( // InvalidStateStore is an invalid state store InvalidStateStore RuntimeStateStore = iota // InMemoryStateStore is an in-memory state that will not persist data // on containers and pods between libpod instances or after system // reboot InMemoryStateStore RuntimeStateStore = iota // SQLiteStateStore is a state backed by a SQLite database // It is presently disabled SQLiteStateStore RuntimeStateStore = iota // BoltDBStateStore is a state backed by a BoltDB database BoltDBStateStore RuntimeStateStore = iota // ContainerCreateTimeout is the timeout before we decide we've failed // to create a container. // TODO: Make this generic - all OCI runtime operations should use the // same timeout, this one. // TODO: Consider dropping from 240 to 60 seconds. I don't think waiting // 4 minutes versus 1 minute makes a real difference. ContainerCreateTimeout = 240 * time.Second )
type SecurityInfo ¶
type SecurityInfo struct { AppArmorEnabled bool `json:"apparmorEnabled"` DefaultCapabilities string `json:"capabilities"` Rootless bool `json:"rootless"` SECCOMPEnabled bool `json:"seccompEnabled"` SECCOMPProfilePath string `json:"seccompProfilePath"` SELinuxEnabled bool `json:"selinuxEnabled"` }
SecurityInfo describes the libpod host
type SlirpInfo ¶
type SlirpInfo struct { Executable string `json:"executable"` Package string `json:"package"` Version string `json:"version"` }
SlirpInfo describes the slirp executable that is being used
type StartupHealthCheck ¶
type StartupHealthCheck struct { manifest.Schema2HealthConfig // Successes are the number of successes required to mark the startup HC // as passed. // If set to 0, a single success will mark the HC as passed. Successes int `json:",omitempty"` }
StartupHealthCheck is the configuration of a startup healthcheck.
type StoreInfo ¶
type StoreInfo struct { ConfigFile string `json:"configFile"` ContainerStore ContainerStore `json:"containerStore"` GraphDriverName string `json:"graphDriverName"` GraphOptions map[string]interface{} `json:"graphOptions"` GraphRoot string `json:"graphRoot"` // GraphRootAllocated is how much space the graphroot has in bytes GraphRootAllocated uint64 `json:"graphRootAllocated"` // GraphRootUsed is how much of graphroot is used in bytes GraphRootUsed uint64 `json:"graphRootUsed"` GraphStatus map[string]string `json:"graphStatus"` ImageCopyTmpDir string `json:"imageCopyTmpDir"` ImageStore ImageStore `json:"imageStore"` RunRoot string `json:"runRoot"` VolumePath string `json:"volumePath"` TransientStore bool `json:"transientStore"` }
StoreInfo describes the container storage and its attributes
type Version ¶
type Version struct { APIVersion string Version string GoVersion string GitCommit string BuiltTime string Built int64 OsArch string Os string }
Version is an output struct for API
func GetVersion ¶
GetVersion returns a VersionOutput struct for API and podman
type VolumeReload ¶
Source Files ¶
- annotations.go
- autoupdate.go
- checkpoint_restore.go
- config.go
- container.go
- container_inspect.go
- containerstate.go
- diff.go
- errors.go
- exec_codes.go
- exit_code_propagation.go
- fileinfo.go
- healthchecks.go
- info.go
- mount.go
- mount_linux.go
- pod_inspect.go
- podstate.go
- runtime.go
- sdnotify.go
- version.go
- volume_inspect.go