Documentation ¶
Index ¶
- Constants
- Variables
- func AddImageNames(store storage.Store, firstRegistry string, systemContext *types.SystemContext, ...) error
- func ExpandNames(names []string, systemContext *types.SystemContext, store storage.Store) ([]string, error)
- func FindImage(store storage.Store, firstRegistry string, systemContext *types.SystemContext, ...) (types.ImageReference, *storage.Image, error)
- func FindLocalRuntime(runtime string) string
- func GID(st os.FileInfo) int
- func GetContainerIDs(uidmap, gidmap []specs.LinuxIDMapping, uid, gid uint32) (uint32, uint32, error)
- func GetFailureCause(err, defaultError error) error
- func GetHostIDs(uidmap, gidmap []specs.LinuxIDMapping, uid, gid uint32) (uint32, uint32, error)
- func GetHostRootIDs(spec *specs.Spec) (uint32, uint32, error)
- func GetPolicyContext(ctx *types.SystemContext) (*signature.PolicyContext, error)
- func IsCgroup2UnifiedMode() (bool, error)
- func LogIfNotRetryable(err error, what string) (retry bool)
- func LogIfUnexpectedWhileDraining(err error, what string)
- func MergeEnv(defaults, overrides []string) []string
- func ResolveNameToReferences(store storage.Store, systemContext *types.SystemContext, image string) (refs []types.ImageReference, err error)
- func Runtime() string
- func SortMounts(m []specs.Mount) []specs.Mount
- func StringInSlice(s string, slice []string) bool
- func TruncateString(str string, to int) string
- func UID(st os.FileInfo) int
- func VerifyTagName(imageSpec string) (types.ImageReference, error)
- func WriteError(w io.Writer, err error, lastError error) error
- type HardlinkChecker
Constants ¶
const ( // DefaultRuntime if containers.conf fails. DefaultRuntime = define.DefaultRuntime )
const ( // DefaultTransport is a prefix that we apply to an image name if we // can't find one in the local Store, in order to generate a source // reference for the image that we can then copy to the local Store. DefaultTransport = "docker://" )
Variables ¶
var ( // DefaultCapabilities is the list of capabilities which we grant by // default to containers which are running under UID 0. DefaultCapabilities = define.DefaultCapabilities // DefaultNetworkSysctl is the list of Kernel parameters which we // grant by default to containers which are running under UID 0. DefaultNetworkSysctl = define.DefaultNetworkSysctl )
var ( // RegistryDefaultPathPrefix contains a per-registry listing of default prefixes // to prepend to image names that only contain a single path component. RegistryDefaultPathPrefix = map[string]string{ "index.docker.io": "library", "docker.io": "library", } )
Functions ¶
func AddImageNames ¶
func AddImageNames(store storage.Store, firstRegistry string, systemContext *types.SystemContext, image *storage.Image, addNames []string) error
AddImageNames adds the specified names to the specified image. Please note that the `firstRegistry` argument has been deprecated and has no effect anymore.
func ExpandNames ¶
func ExpandNames(names []string, systemContext *types.SystemContext, store storage.Store) ([]string, error)
ExpandNames takes unqualified names, parses them as image names, and returns the fully expanded result, including a tag. Names which don't include a registry name will be marked for the most-preferred registry (i.e., the first one in our configuration).
func FindImage ¶
func FindImage(store storage.Store, firstRegistry string, systemContext *types.SystemContext, image string) (types.ImageReference, *storage.Image, error)
FindImage locates the locally-stored image which corresponds to a given name. Please note that the `firstRegistry` argument has been deprecated and has no effect anymore.
func FindLocalRuntime ¶ added in v1.14.1
FindLocalRuntime find the local runtime of the system searching through the config file for possible locations.
func GetContainerIDs ¶ added in v1.8.4
func GetContainerIDs(uidmap, gidmap []specs.LinuxIDMapping, uid, gid uint32) (uint32, uint32, error)
GetContainerIDs uses ID mappings to compute the container-level IDs that will correspond to a UID/GID pair on the host.
func GetFailureCause ¶
GetFailureCause checks the type of the error "err" and returns a new error message that reflects the reason of the failure. In case err type is not a familiar one the error "defaultError" is returned.
func GetHostIDs ¶ added in v1.7.1
GetHostIDs uses ID mappings to compute the host-level IDs that will correspond to a UID/GID pair in the container.
func GetHostRootIDs ¶ added in v1.7.1
GetHostRootIDs uses ID mappings in spec to compute the host-level IDs that will correspond to UID/GID 0/0 in the container.
func GetPolicyContext ¶ added in v1.7.1
func GetPolicyContext(ctx *types.SystemContext) (*signature.PolicyContext, error)
GetPolicyContext sets up, initializes and returns a new context for the specified policy
func IsCgroup2UnifiedMode ¶ added in v1.13.2
IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
func LogIfNotRetryable ¶ added in v1.7.1
LogIfNotRetryable logs "what" if err is set and is not an EINTR or EAGAIN syscall.Errno. Returns "true" if we can continue.
func LogIfUnexpectedWhileDraining ¶ added in v1.7.1
LogIfUnexpectedWhileDraining logs "what" if err is set and is not an EINTR or EAGAIN or EIO syscall.Errno.
func MergeEnv ¶ added in v1.16.0
MergeEnv merges two lists of environment variables, avoiding duplicates.
func ResolveNameToReferences ¶ added in v1.14.1
func ResolveNameToReferences( store storage.Store, systemContext *types.SystemContext, image string, ) (refs []types.ImageReference, err error)
resolveNameToReferences tries to create a list of possible references (including their transports) from the provided image name.
func Runtime ¶ added in v1.7.1
func Runtime() string
Runtime is the default command to use to run the container.
func StringInSlice ¶ added in v1.7.1
StringInSlice is deprecated, use github.com/containers/common/pkg/util.StringInSlice
func TruncateString ¶ added in v1.11.1
TruncateString trims the given string to the provided maximum amount of characters and shortens it with `...`.
func VerifyTagName ¶ added in v1.21.0
func VerifyTagName(imageSpec string) (types.ImageReference, error)
Types ¶
type HardlinkChecker ¶ added in v1.11.0
type HardlinkChecker struct {
// contains filtered or unexported fields
}