Skip to content

Commit

Permalink
Merge pull request #8623 from vrothberg/fix-8558
Browse files Browse the repository at this point in the history
container create: do not clear image name
  • Loading branch information
openshift-merge-robot committed Dec 7, 2020
2 parents 0c96731 + f294d89 commit e117ad3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion pkg/specgen/generate/container_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
// present.
imgName := newImage.InputName
if s.Image == newImage.InputName && strings.HasPrefix(newImage.ID(), s.Image) {
imgName = ""
names := newImage.Names()
if len(names) > 0 {
imgName = names[0]
Expand Down
11 changes: 11 additions & 0 deletions test/system/030-run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,17 @@ json-file | f
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" {
run_podman run --rm $IMAGE ls -1 /run/.containerenv
is "$output" "/run/.containerenv"
Expand Down

0 comments on commit e117ad3

Please sign in to comment.