github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/libpod/define/config.go (about) 1 package define 2 3 import ( 4 "bufio" 5 "io" 6 "regexp" 7 8 "github.com/containers/common/libnetwork/types" 9 ) 10 11 var ( 12 // DefaultSHMLockPath is the default path for SHM locks 13 DefaultSHMLockPath = "/libpod_lock" 14 // DefaultRootlessSHMLockPath is the default path for rootless SHM locks 15 DefaultRootlessSHMLockPath = "/libpod_rootless_lock" 16 17 // NameRegex is a regular expression to validate container/pod names. 18 // This must NOT be changed from outside of Libpod. It should be a 19 // constant, but Go won't let us do that. 20 NameRegex = types.NameRegex 21 // RegexError is thrown in presence of an invalid container/pod name. 22 RegexError = types.RegexError 23 // UmaskRegex is a regular expression to validate Umask. 24 UmaskRegex = regexp.MustCompile(`^[0-7]{1,4}$`) 25 ) 26 27 const ( 28 // DefaultTransport is a prefix that we apply to an image name 29 // to check docker hub first for the image 30 DefaultTransport = "docker://" 31 ) 32 33 // InfoData holds the info type, i.e store, host etc and the data for each type 34 type InfoData struct { 35 Type string 36 Data map[string]interface{} 37 } 38 39 // VolumeDriverLocal is the "local" volume driver. It is managed by libpod 40 // itself. 41 const VolumeDriverLocal = "local" 42 43 const ( 44 OCIManifestDir = "oci-dir" 45 OCIArchive = "oci-archive" 46 V2s2ManifestDir = "docker-dir" 47 V2s2Archive = "docker-archive" 48 ) 49 50 // AttachStreams contains streams that will be attached to the container 51 type AttachStreams struct { 52 // OutputStream will be attached to container's STDOUT 53 OutputStream io.WriteCloser 54 // ErrorStream will be attached to container's STDERR 55 ErrorStream io.WriteCloser 56 // InputStream will be attached to container's STDIN 57 InputStream *bufio.Reader 58 // AttachOutput is whether to attach to STDOUT 59 // If false, stdout will not be attached 60 AttachOutput bool 61 // AttachError is whether to attach to STDERR 62 // If false, stdout will not be attached 63 AttachError bool 64 // AttachInput is whether to attach to STDIN 65 // If false, stdout will not be attached 66 AttachInput bool 67 } 68 69 // JournaldLogging is the string conmon expects to specify journald logging 70 const JournaldLogging = "journald" 71 72 // KubernetesLogging is the string conmon expects when specifying to use the kubernetes logging format 73 const KubernetesLogging = "k8s-file" 74 75 // JSONLogging is the string conmon expects when specifying to use the json logging format 76 const JSONLogging = "json-file" 77 78 // NoLogging is the string conmon expects when specifying to use no log driver whatsoever 79 const NoLogging = "none" 80 81 // PassthroughLogging is the string conmon expects when specifying to use the passthrough driver 82 const PassthroughLogging = "passthrough" 83 84 // Strings used for --sdnotify option to podman 85 const ( 86 SdNotifyModeContainer = "container" 87 SdNotifyModeConmon = "conmon" 88 SdNotifyModeIgnore = "ignore" 89 ) 90 91 // DefaultRlimitValue is the value set by default for nofile and nproc 92 const RLimitDefaultValue = uint64(1048576) 93 94 // BindMountPrefix distinguishes its annotations from others 95 const BindMountPrefix = "bind-mount-options:"