Skip to content

Commit

Permalink
Merge pull request containers#875 from Luap99/revert-864
Browse files Browse the repository at this point in the history
Revert "pull: fix pulling from dir transport"
  • Loading branch information
rhatdan authored Jan 7, 2022
2 parents 003e0f7 + 362db31 commit e275f5e
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 14 deletions.
10 changes: 2 additions & 8 deletions libimage/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,8 @@ func (r *Runtime) copyFromDefault(ctx context.Context, ref types.ImageReference,
imageName = named.String()

default:
// Path-based transports (e.g., dir) may include invalid
// characters, so we should pessimistically generate an ID
// instead of looking at the StringWithinTransport().
storageName, err = getImageID(ctx, ref, nil)
if err != nil {
return nil, err
}
imageName = "sha256:" + storageName[1:]
storageName = toLocalImageName(ref.StringWithinTransport())
imageName = storageName
}

// Create a storage reference.
Expand Down
3 changes: 0 additions & 3 deletions libimage/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ func TestPull(t *testing.T) {
{"docker://docker.io/library/alpine", false, 1, []string{"docker.io/library/alpine:latest"}},
{"quay.io/libpod/alpine@sha256:634a8f35b5f16dcf4aaa0822adc0b1964bb786fca12f6831de8ddc45e5986a00", false, 1, []string{"quay.io/libpod/alpine@sha256:634a8f35b5f16dcf4aaa0822adc0b1964bb786fca12f6831de8ddc45e5986a00"}},
{"quay.io/libpod/alpine:pleaseignorethistag@sha256:634a8f35b5f16dcf4aaa0822adc0b1964bb786fca12f6831de8ddc45e5986a00", false, 1, []string{"quay.io/libpod/alpine@sha256:634a8f35b5f16dcf4aaa0822adc0b1964bb786fca12f6831de8ddc45e5986a00"}},

// DIR
{"dir:testdata/scratch-dir-5pec!@L", false, 1, []string{"61e17f84d763cc086d43c67dcf4cdbd69f9224c74e961c53b589b70499eac443"}},
} {
pulledImages, err := runtime.Pull(ctx, test.input, config.PullPolicyAlways, pullOptions)
if test.expectError {
Expand Down
Binary file not shown.

This file was deleted.

1 change: 0 additions & 1 deletion libimage/testdata/scratch-dir-5pec!@L/manifest.json

This file was deleted.

1 change: 0 additions & 1 deletion libimage/testdata/scratch-dir-5pec!@L/version

This file was deleted.

0 comments on commit e275f5e

Please sign in to comment.