mirror of
https://github.com/containers/podman.git
synced 2025-08-01 07:40:22 +08:00
support tag@digest notation
Vendor in the latest HEAd of containers/common to implicitly support the tag@digest notation for images. To remain compatible with Docker, the tag will be stripped off the image reference and is entirely ignored. Fixes: #6721 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
40
vendor/github.com/containers/common/pkg/config/systemd.go
generated
vendored
40
vendor/github.com/containers/common/pkg/config/systemd.go
generated
vendored
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user