vendor containers/common@main

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2021-07-16 17:32:37 +02:00
parent 3ef124b03f
commit 2e02942d46
9 changed files with 46 additions and 6 deletions

View File

@ -80,6 +80,10 @@ func (i *Image) Tree(traverseChildren bool) (string, error) {
}
func imageTreeTraverseChildren(node *layerNode, parent gotree.Tree) error {
if node.layer == nil {
return nil
}
var tags string
repoTags, err := node.repoTags()
if err != nil {

View File

@ -394,8 +394,23 @@ func (r *Runtime) copySingleImageFromRegistry(ctx context.Context, imageName str
// very likely a bug but a consistent one in Podman/Buildah and should
// be addressed at a later point.
if pullPolicy != config.PullPolicyAlways {
logrus.Debugf("Enforcing pull policy to %q to support custom platform (arch: %q, os: %q, variant: %q)", "always", options.Architecture, options.OS, options.Variant)
pullPolicy = config.PullPolicyAlways
switch {
// User input clearly refer to a local image.
case strings.HasPrefix(imageName, "localhost/"):
logrus.Debugf("Enforcing pull policy to %q to support custom platform (arch: %q, os: %q, variant: %q)", "never", options.Architecture, options.OS, options.Variant)
pullPolicy = config.PullPolicyNever
// Image resolved to a local one, so let's still have a
// look at the registries or aliases but use it
// otherwise.
case strings.HasPrefix(resolvedImageName, "localhost/"):
logrus.Debugf("Enforcing pull policy to %q to support custom platform (arch: %q, os: %q, variant: %q)", "newer", options.Architecture, options.OS, options.Variant)
pullPolicy = config.PullPolicyNewer
default:
logrus.Debugf("Enforcing pull policy to %q to support custom platform (arch: %q, os: %q, variant: %q)", "always", options.Architecture, options.OS, options.Variant)
pullPolicy = config.PullPolicyAlways
}
}
}

View File

@ -158,6 +158,13 @@ type ContainersConfig struct {
// PidNS indicates how to create a pid namespace for the container
PidNS string `toml:"pidns,omitempty"`
// Copy the content from the underlying image into the newly created
// volume when the container is created instead of when it is started.
// If false, the container engine will not copy the content until
// the container is started. Setting it to true may have negative
// performance implications.
PrepareVolumeOnCreate bool `toml:"prepare_volume_on_create,omitempty"`
// RootlessNetworking depicts the "kind" of networking for rootless
// containers. Valid options are `slirp4netns` and `cni`. Default is
// `slirp4netns`
@ -384,6 +391,10 @@ type EngineConfig struct {
// will refer to the plugin as) mapped to a path, which must point to a
// Unix socket that conforms to the Volume Plugin specification.
VolumePlugins map[string]string `toml:"volume_plugins,omitempty"`
// ChownCopiedFiles tells the container engine whether to chown files copied
// into a container to the container's primary uid/gid.
ChownCopiedFiles bool `toml:"chown_copied_files"`
}
// SetOptions contains a subset of options in a Config. It's used to indicate if

View File

@ -189,6 +189,13 @@ default_sysctls = [
#
# pids_limit = 2048
# Copy the content from the underlying image into the newly created volume
# when the container is created instead of when it is started. If false,
# the container engine will not copy the content until the container is started.
# Setting it to true may have negative performance implications.
#
# prepare_volume_on_create = false
# Indicates the networking to be used for rootless containers
# rootless_networking = "slirp4netns"

View File

@ -340,6 +340,8 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
c.LockType = "shm"
c.MachineEnabled = false
c.ChownCopiedFiles = true
return c, nil
}

View File

@ -1,4 +1,4 @@
package version
// Version is the version of the build.
const Version = "0.40.2-dev"
const Version = "0.41.1-dev"