aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-09 05:46:05 -0400
committerGitHub <noreply@github.com>2021-07-09 05:46:05 -0400
commit60d12f72b972d44ee20e95eb99c64a233069bf73 (patch)
treeed59f4cc2160064434a8261eb9c598fde5d7d353
parent275b0d82636474b0a3c631e63d0da2c2575b7987 (diff)
parentbed195bf8c80d94519ded994050d6e85826734cc (diff)
downloadpodman-60d12f72b972d44ee20e95eb99c64a233069bf73.tar.gz
podman-60d12f72b972d44ee20e95eb99c64a233069bf73.tar.bz2
podman-60d12f72b972d44ee20e95eb99c64a233069bf73.zip
Merge pull request #10871 from vrothberg/3.2-vendor-common
[3.2] vendor containers/common@v0.38.15
-rw-r--r--go.mod2
-rw-r--r--go.sum4
-rw-r--r--vendor/github.com/containers/common/libimage/import.go28
-rw-r--r--vendor/github.com/containers/common/pkg/config/default.go2
-rw-r--r--vendor/github.com/containers/common/pkg/config/nosystemd.go10
-rw-r--r--vendor/github.com/containers/common/pkg/config/systemd.go40
-rw-r--r--vendor/github.com/containers/common/version/version.go2
-rw-r--r--vendor/modules.txt2
8 files changed, 73 insertions, 17 deletions
diff --git a/go.mod b/go.mod
index 99c27b9d6..32b789510 100644
--- a/go.mod
+++ b/go.mod
@@ -12,7 +12,7 @@ require (
github.com/containernetworking/cni v0.8.1
github.com/containernetworking/plugins v0.9.1
github.com/containers/buildah v1.21.0
- github.com/containers/common v0.38.14
+ github.com/containers/common v0.38.15
github.com/containers/conmon v2.0.20+incompatible
github.com/containers/image/v5 v5.12.0
github.com/containers/ocicrypt v1.1.1
diff --git a/go.sum b/go.sum
index ac6daf432..23ff96c8b 100644
--- a/go.sum
+++ b/go.sum
@@ -218,8 +218,8 @@ github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRD
github.com/containers/buildah v1.21.0 h1:LuwuqRPjan3X3AIdGwfkEkqMgmrDMNpQznFqNdHgCz8=
github.com/containers/buildah v1.21.0/go.mod h1:yPdlpVd93T+i91yGxrJbW1YOWrqN64j5ZhHOZmHUejs=
github.com/containers/common v0.38.4/go.mod h1:egfpX/Y3+19Dz4Wa1eRZDdgzoEOeneieF9CQppKzLBg=
-github.com/containers/common v0.38.14 h1:6fp6+NpG/JhhGboRuUuc4fDaXHoHnSW9n/qL2iGQlLA=
-github.com/containers/common v0.38.14/go.mod h1:egfpX/Y3+19Dz4Wa1eRZDdgzoEOeneieF9CQppKzLBg=
+github.com/containers/common v0.38.15 h1:esHGxhaqjb5GihF9uO2KZoSGcydIB1PxjZojDipkN6E=
+github.com/containers/common v0.38.15/go.mod h1:egfpX/Y3+19Dz4Wa1eRZDdgzoEOeneieF9CQppKzLBg=
github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg=
github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
github.com/containers/image/v5 v5.12.0 h1:1hNS2QkzFQ4lH3GYQLyAXB0acRMhS1Ubm6oV++8vw4w=
diff --git a/vendor/github.com/containers/common/libimage/import.go b/vendor/github.com/containers/common/libimage/import.go
index 4cce4c9ca..c11e86d67 100644
--- a/vendor/github.com/containers/common/libimage/import.go
+++ b/vendor/github.com/containers/common/libimage/import.go
@@ -80,16 +80,12 @@ func (r *Runtime) Import(ctx context.Context, path string, options *ImportOption
return "", err
}
- name := options.Tag
- if name == "" {
- name, err = getImageDigest(ctx, srcRef, r.systemContextCopy())
- if err != nil {
- return "", err
- }
- name = "sha256:" + name[1:] // strip leading "@"
+ id, err := getImageDigest(ctx, srcRef, r.systemContextCopy())
+ if err != nil {
+ return "", err
}
- destRef, err := storageTransport.Transport.ParseStoreReference(r.store, name)
+ destRef, err := storageTransport.Transport.ParseStoreReference(r.store, id)
if err != nil {
return "", err
}
@@ -104,5 +100,19 @@ func (r *Runtime) Import(ctx context.Context, path string, options *ImportOption
return "", err
}
- return name, nil
+ // Strip the leading @ off the id.
+ name := id[1:]
+
+ // If requested, tag the imported image.
+ if options.Tag != "" {
+ image, _, err := r.LookupImage(name, nil)
+ if err != nil {
+ return "", errors.Wrap(err, "looking up imported image")
+ }
+ if err := image.Tag(options.Tag); err != nil {
+ return "", err
+ }
+ }
+
+ return "sha256:" + name, nil
}
diff --git a/vendor/github.com/containers/common/pkg/config/default.go b/vendor/github.com/containers/common/pkg/config/default.go
index 133f9f073..794efc32e 100644
--- a/vendor/github.com/containers/common/pkg/config/default.go
+++ b/vendor/github.com/containers/common/pkg/config/default.go
@@ -191,7 +191,7 @@ func DefaultConfig() (*Config, error) {
Init: false,
InitPath: "",
IPCNS: "private",
- LogDriver: DefaultLogDriver,
+ LogDriver: defaultLogDriver(),
LogSizeMax: DefaultLogSizeMax,
NetNS: netns,
NoHosts: false,
diff --git a/vendor/github.com/containers/common/pkg/config/nosystemd.go b/vendor/github.com/containers/common/pkg/config/nosystemd.go
index 5b82b1389..6e39a6ccd 100644
--- a/vendor/github.com/containers/common/pkg/config/nosystemd.go
+++ b/vendor/github.com/containers/common/pkg/config/nosystemd.go
@@ -3,9 +3,17 @@
package config
func defaultCgroupManager() string {
- return "cgroupfs"
+ return CgroupfsCgroupsManager
}
func defaultEventsLogger() string {
return "file"
}
+
+func defaultLogDriver() string {
+ return DefaultLogDriver
+}
+
+func useSystemd() bool {
+ return false
+}
diff --git a/vendor/github.com/containers/common/pkg/config/systemd.go b/vendor/github.com/containers/common/pkg/config/systemd.go
index 02e5c4ac2..ed014126b 100644
--- a/vendor/github.com/containers/common/pkg/config/systemd.go
+++ b/vendor/github.com/containers/common/pkg/config/systemd.go
@@ -3,11 +3,23 @@
package config
import (
+ "io/ioutil"
+ "strings"
+ "sync"
+
"github.com/containers/common/pkg/cgroupv2"
"github.com/containers/storage/pkg/unshare"
)
+var (
+ systemdOnce sync.Once
+ usesSystemd bool
+)
+
func defaultCgroupManager() string {
+ if !useSystemd() {
+ return CgroupfsCgroupsManager
+ }
enabled, err := cgroupv2.Enabled()
if err == nil && !enabled && unshare.IsRootless() {
return CgroupfsCgroupsManager
@@ -15,6 +27,32 @@ func defaultCgroupManager() string {
return SystemdCgroupsManager
}
+
func defaultEventsLogger() string {
- return "journald"
+ if useSystemd() {
+ 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
+ }
+
+ return DefaultLogDriver
+
+}
+
+func useSystemd() bool {
+ systemdOnce.Do(func() {
+ dat, err := ioutil.ReadFile("/proc/1/comm")
+ if err == nil {
+ val := strings.TrimSuffix(string(dat), "\n")
+ usesSystemd = (val == "systemd")
+ }
+ return
+ })
+ return usesSystemd
}
diff --git a/vendor/github.com/containers/common/version/version.go b/vendor/github.com/containers/common/version/version.go
index 5e09d56a2..28da9dca4 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.38.14"
+const Version = "0.38.15"
diff --git a/vendor/modules.txt b/vendor/modules.txt
index cada866cf..adb83220d 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -91,7 +91,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.38.14
+# github.com/containers/common v0.38.15
github.com/containers/common/libimage
github.com/containers/common/libimage/manifests
github.com/containers/common/pkg/apparmor