mirror of
https://github.com/containers/podman.git
synced 2025-11-15 18:48:07 +08:00
image lookup: do not match *any* tags
For reasons buried in the history of Podman, looking up an untagged image would match any tag of matching image. For instance, looking up centos would match a local image centos:foobar. Change that behavior to only match the latest tag. Fix: #11964 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
21
vendor/github.com/containers/storage/pkg/reexec/reexec.go
generated
vendored
21
vendor/github.com/containers/storage/pkg/reexec/reexec.go
generated
vendored
@@ -7,7 +7,10 @@ import (
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
var registeredInitializers = make(map[string]func())
|
||||
var (
|
||||
registeredInitializers = make(map[string]func())
|
||||
initWasCalled = false
|
||||
)
|
||||
|
||||
// Register adds an initialization func under the specified name
|
||||
func Register(name string, initializer func()) {
|
||||
@@ -22,6 +25,7 @@ func Register(name string, initializer func()) {
|
||||
// initialization function was called.
|
||||
func Init() bool {
|
||||
initializer, exists := registeredInitializers[os.Args[0]]
|
||||
initWasCalled = true
|
||||
if exists {
|
||||
initializer()
|
||||
|
||||
@@ -30,6 +34,21 @@ func Init() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func panicIfNotInitialized() {
|
||||
if !initWasCalled {
|
||||
// The reexec package is used to run subroutines in
|
||||
// subprocesses which would otherwise have unacceptable side
|
||||
// effects on the main thread. If you found this error, then
|
||||
// your program uses a package which needs to do this. In
|
||||
// order for that to work, main() should start with this
|
||||
// boilerplate, or an equivalent:
|
||||
// if reexec.Init() {
|
||||
// return
|
||||
// }
|
||||
panic("a library subroutine needed to run a subprocess, but reexec.Init() was not called in main()")
|
||||
}
|
||||
}
|
||||
|
||||
func naiveSelf() string {
|
||||
name := os.Args[0]
|
||||
if filepath.Base(name) == name {
|
||||
|
||||
Reference in New Issue
Block a user