summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/containers/common/libimage/image.go23
-rw-r--r--vendor/github.com/containers/common/pkg/auth/auth.go2
-rw-r--r--vendor/github.com/containers/common/pkg/config/config.go7
-rw-r--r--vendor/github.com/containers/common/pkg/config/containers.conf6
-rw-r--r--vendor/github.com/containers/common/pkg/config/default.go10
-rw-r--r--vendor/github.com/containers/common/pkg/config/nosystemd.go7
-rw-r--r--vendor/github.com/containers/common/pkg/config/systemd.go41
-rw-r--r--vendor/github.com/containers/common/pkg/parse/parse.go3
-rw-r--r--vendor/github.com/containers/common/version/version.go2
-rw-r--r--vendor/modules.txt2
10 files changed, 81 insertions, 22 deletions
diff --git a/vendor/github.com/containers/common/libimage/image.go b/vendor/github.com/containers/common/libimage/image.go
index c47e63339..b4623a870 100644
--- a/vendor/github.com/containers/common/libimage/image.go
+++ b/vendor/github.com/containers/common/libimage/image.go
@@ -448,14 +448,24 @@ func (i *Image) removeRecursive(ctx context.Context, rmMap map[string]*RemoveIma
return parent.removeRecursive(ctx, rmMap, processedIDs, "", options)
}
+var errTagDigest = errors.New("tag by digest not supported")
+
// Tag the image with the specified name and store it in the local containers
// storage. The name is normalized according to the rules of NormalizeName.
func (i *Image) Tag(name string) error {
+ if strings.HasPrefix(name, "sha256:") { // ambiguous input
+ return errors.Wrap(errTagDigest, name)
+ }
+
ref, err := NormalizeName(name)
if err != nil {
return errors.Wrapf(err, "error normalizing name %q", name)
}
+ if _, isDigested := ref.(reference.Digested); isDigested {
+ return errors.Wrap(errTagDigest, name)
+ }
+
logrus.Debugf("Tagging image %s with %q", i.ID(), ref.String())
if i.runtime.eventChannel != nil {
defer i.runtime.writeEvent(&Event{ID: i.ID(), Name: name, Time: time.Now(), Type: EventTypeImageTag})
@@ -480,7 +490,7 @@ var errUntagDigest = errors.New("untag by digest not supported")
// the local containers storage. The name is normalized according to the rules
// of NormalizeName.
func (i *Image) Untag(name string) error {
- if strings.HasPrefix(name, "sha256:") {
+ if strings.HasPrefix(name, "sha256:") { // ambiguous input
return errors.Wrap(errUntagDigest, name)
}
@@ -488,6 +498,17 @@ func (i *Image) Untag(name string) error {
if err != nil {
return errors.Wrapf(err, "error normalizing name %q", name)
}
+
+ // FIXME: this is breaking Podman CI but must be re-enabled once
+ // c/storage supports alterting the digests of an image. Then,
+ // Podman will do the right thing.
+ //
+ // !!! Also make sure to re-enable the tests !!!
+ //
+ // if _, isDigested := ref.(reference.Digested); isDigested {
+ // return errors.Wrap(errUntagDigest, name)
+ // }
+
name = ref.String()
logrus.Debugf("Untagging %q from image %s", ref.String(), i.ID())
diff --git a/vendor/github.com/containers/common/pkg/auth/auth.go b/vendor/github.com/containers/common/pkg/auth/auth.go
index 093da0299..0934b155f 100644
--- a/vendor/github.com/containers/common/pkg/auth/auth.go
+++ b/vendor/github.com/containers/common/pkg/auth/auth.go
@@ -104,7 +104,6 @@ func Login(ctx context.Context, systemContext *types.SystemContext, opts *LoginO
return errors.Wrap(err, "get credentials for repository")
}
} else {
- // nolint: staticcheck
authConfig, err = config.GetCredentials(systemContext, registry)
if err != nil {
return errors.Wrap(err, "get credentials")
@@ -321,7 +320,6 @@ func Logout(systemContext *types.SystemContext, opts *LogoutOptions, args []stri
return errors.Wrap(err, "get credentials for repository")
}
} else {
- // nolint: staticcheck
authConfig, err = config.GetCredentials(systemContext, registry)
if err != nil {
return errors.Wrap(err, "get credentials")
diff --git a/vendor/github.com/containers/common/pkg/config/config.go b/vendor/github.com/containers/common/pkg/config/config.go
index 008cfb642..e554bac70 100644
--- a/vendor/github.com/containers/common/pkg/config/config.go
+++ b/vendor/github.com/containers/common/pkg/config/config.go
@@ -274,6 +274,9 @@ type EngineConfig struct {
// MachineEnabled indicates if Podman is running in a podman-machine VM
MachineEnabled bool `toml:"machine_enabled,omitempty"`
+ // MachineImage is the image used when creating a podman-machine VM
+ MachineImage string `toml:"machine_image,omitempty"`
+
// MultiImageArchive - if true, the container engine allows for storing
// archives (e.g., of the docker-archive transport) with multiple
// images. By default, Podman creates single-image archives.
@@ -691,8 +694,8 @@ func (c *Config) Validate() error {
}
func (c *EngineConfig) findRuntime() string {
- // Search for crun first followed by runc and kata
- for _, name := range []string{"crun", "runc", "kata"} {
+ // Search for crun first followed by runc, kata, runsc
+ for _, name := range []string{"crun", "runc", "kata", "runsc"} {
for _, v := range c.OCIRuntimes[name] {
if _, err := os.Stat(v); err == nil {
return name
diff --git a/vendor/github.com/containers/common/pkg/config/containers.conf b/vendor/github.com/containers/common/pkg/config/containers.conf
index a83aa9407..0068a9a17 100644
--- a/vendor/github.com/containers/common/pkg/config/containers.conf
+++ b/vendor/github.com/containers/common/pkg/config/containers.conf
@@ -61,7 +61,7 @@ default_capabilities = [
# A list of sysctls to be set in containers by default,
# specified as "name=value",
-# for example:"net.ipv4.ping_group_range = 0 0".
+# for example:"net.ipv4.ping_group_range=0 0".
#
default_sysctls = [
"net.ipv4.ping_group_range=0 0",
@@ -381,6 +381,10 @@ default_sysctls = [
#
#machine_enabled = false
+# The image used when creating a podman-machine VM.
+#
+#machine_image = "testing"
+
# MultiImageArchive - if true, the container engine allows for storing archives
# (e.g., of the docker-archive transport) with multiple images. By default,
# Podman creates single-image archives.
diff --git a/vendor/github.com/containers/common/pkg/config/default.go b/vendor/github.com/containers/common/pkg/config/default.go
index a16dd0e02..66531a2ba 100644
--- a/vendor/github.com/containers/common/pkg/config/default.go
+++ b/vendor/github.com/containers/common/pkg/config/default.go
@@ -105,8 +105,6 @@ const (
DefaultApparmorProfile = apparmor.Profile
// SystemdCgroupsManager represents systemd native cgroup manager
SystemdCgroupsManager = "systemd"
- // DefaultLogDriver is the default type of log files
- DefaultLogDriver = "k8s-file"
// DefaultLogSizeMax is the default value for the maximum log size
// allowed for a container. Negative values mean that no limit is imposed.
DefaultLogSizeMax = -1
@@ -339,6 +337,7 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
// constants.
c.LockType = "shm"
c.MachineEnabled = false
+ c.MachineImage = "testing"
c.ChownCopiedFiles = true
@@ -549,6 +548,7 @@ func (c *Config) LogDriver() string {
return c.Containers.LogDriver
}
+// MachineEnabled returns if podman is running inside a VM or not
func (c *Config) MachineEnabled() bool {
return c.Engine.MachineEnabled
}
@@ -558,3 +558,9 @@ func (c *Config) MachineEnabled() bool {
func (c *Config) RootlessNetworking() string {
return c.Containers.RootlessNetworking
}
+
+// MachineImage returns the image to be
+// used when creating a podman-machine VM
+func (c *Config) MachineImage() string {
+ return c.Engine.MachineImage
+}
diff --git a/vendor/github.com/containers/common/pkg/config/nosystemd.go b/vendor/github.com/containers/common/pkg/config/nosystemd.go
index 6e39a6ccd..2a3b6fb35 100644
--- a/vendor/github.com/containers/common/pkg/config/nosystemd.go
+++ b/vendor/github.com/containers/common/pkg/config/nosystemd.go
@@ -1,7 +1,12 @@
-// +build !systemd
+// +build !systemd !cgo
package config
+const (
+ // DefaultLogDriver is the default type of log files
+ DefaultLogDriver = "k8s-file"
+)
+
func defaultCgroupManager() string {
return CgroupfsCgroupsManager
}
diff --git a/vendor/github.com/containers/common/pkg/config/systemd.go b/vendor/github.com/containers/common/pkg/config/systemd.go
index ed014126b..fab3ea437 100644
--- a/vendor/github.com/containers/common/pkg/config/systemd.go
+++ b/vendor/github.com/containers/common/pkg/config/systemd.go
@@ -1,4 +1,4 @@
-// +build systemd
+// +build systemd,cgo
package config
@@ -9,11 +9,19 @@ import (
"github.com/containers/common/pkg/cgroupv2"
"github.com/containers/storage/pkg/unshare"
+ "github.com/coreos/go-systemd/v22/sdjournal"
)
var (
- systemdOnce sync.Once
- usesSystemd bool
+ systemdOnce sync.Once
+ usesSystemd bool
+ journaldOnce sync.Once
+ usesJournald bool
+)
+
+const (
+ // DefaultLogDriver is the default type of log files
+ DefaultLogDriver = "journald"
)
func defaultCgroupManager() string {
@@ -29,20 +37,17 @@ func defaultCgroupManager() string {
}
func defaultEventsLogger() string {
- if useSystemd() {
+ if useJournald() {
return "journald"
}
return "file"
}
func defaultLogDriver() string {
- // If we decide to change the default for logdriver, it should be done here.
- if useSystemd() {
- return DefaultLogDriver
+ if useJournald() {
+ return "journald"
}
-
- return DefaultLogDriver
-
+ return "k8s-file"
}
func useSystemd() bool {
@@ -56,3 +61,19 @@ func useSystemd() bool {
})
return usesSystemd
}
+
+func useJournald() bool {
+ journaldOnce.Do(func() {
+ if !useSystemd() {
+ return
+ }
+ journal, err := sdjournal.NewJournal()
+ if err != nil {
+ return
+ }
+ journal.Close()
+ usesJournald = true
+ return
+ })
+ return usesJournald
+}
diff --git a/vendor/github.com/containers/common/pkg/parse/parse.go b/vendor/github.com/containers/common/pkg/parse/parse.go
index 1a25957d6..02e670c50 100644
--- a/vendor/github.com/containers/common/pkg/parse/parse.go
+++ b/vendor/github.com/containers/common/pkg/parse/parse.go
@@ -5,6 +5,7 @@ package parse
import (
"os"
+ "path"
"path/filepath"
"strings"
@@ -155,7 +156,7 @@ func ValidateVolumeCtrDir(ctrDir string) error {
if ctrDir == "" {
return errors.New("container directory cannot be empty")
}
- if !filepath.IsAbs(ctrDir) {
+ if !path.IsAbs(ctrDir) {
return errors.Errorf("invalid container path %q, must be an absolute path", ctrDir)
}
return nil
diff --git a/vendor/github.com/containers/common/version/version.go b/vendor/github.com/containers/common/version/version.go
index 1e9e48f33..572fe9bbd 100644
--- a/vendor/github.com/containers/common/version/version.go
+++ b/vendor/github.com/containers/common/version/version.go
@@ -1,4 +1,4 @@
package version
// Version is the version of the build.
-const Version = "0.42.1"
+const Version = "0.43.2"
diff --git a/vendor/modules.txt b/vendor/modules.txt
index c1cfbe76d..c9e56cdc0 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -94,7 +94,7 @@ github.com/containers/buildah/pkg/overlay
github.com/containers/buildah/pkg/parse
github.com/containers/buildah/pkg/rusage
github.com/containers/buildah/util
-# github.com/containers/common v0.42.1
+# github.com/containers/common v0.43.2
github.com/containers/common/libimage
github.com/containers/common/libimage/manifests
github.com/containers/common/pkg/apparmor