mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
Merge pull request #8623 from vrothberg/fix-8558
container create: do not clear image name
This commit is contained in:
@ -98,7 +98,6 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
|
|||||||
// present.
|
// present.
|
||||||
imgName := newImage.InputName
|
imgName := newImage.InputName
|
||||||
if s.Image == newImage.InputName && strings.HasPrefix(newImage.ID(), s.Image) {
|
if s.Image == newImage.InputName && strings.HasPrefix(newImage.ID(), s.Image) {
|
||||||
imgName = ""
|
|
||||||
names := newImage.Names()
|
names := newImage.Names()
|
||||||
if len(names) > 0 {
|
if len(names) > 0 {
|
||||||
imgName = names[0]
|
imgName = names[0]
|
||||||
|
@ -536,6 +536,17 @@ json-file | f
|
|||||||
run_podman untag $IMAGE $newtag $newtag2
|
run_podman untag $IMAGE $newtag $newtag2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Regression test for issue #8558
|
||||||
|
@test "podman run on untagged image: make sure that image metadata is set" {
|
||||||
|
run_podman inspect $IMAGE --format "{{.ID}}"
|
||||||
|
imageID="$output"
|
||||||
|
|
||||||
|
run_podman untag $IMAGE
|
||||||
|
run_podman run --rm $imageID ls
|
||||||
|
|
||||||
|
run_podman tag $imageID $IMAGE
|
||||||
|
}
|
||||||
|
|
||||||
@test "Verify /run/.containerenv exist" {
|
@test "Verify /run/.containerenv exist" {
|
||||||
run_podman run --rm $IMAGE ls -1 /run/.containerenv
|
run_podman run --rm $IMAGE ls -1 /run/.containerenv
|
||||||
is "$output" "/run/.containerenv"
|
is "$output" "/run/.containerenv"
|
||||||
|
Reference in New Issue
Block a user