mirror of
https://github.com/containers/podman.git
synced 2025-06-27 13:38:49 +08:00
Remove an unnecessary use of alltransports.ParseImageName
When the string is formatted including a constant transport name, just call the transport to create or parse a reference explicitly. This avoids unnecessary string formatting and parsing. Then drop image.TarballTransport, which has no remaining users. Should not change behavior (but does not add unit tests). Signed-off-by: Miloslav Trmač <mitr@redhat.com> Closes: #1176 Approved by: rhatdan
This commit is contained in:

committed by
Atomic Bot

parent
90abdfdff5
commit
86fb1bf8eb
@ -878,8 +878,7 @@ func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error) {
|
||||
|
||||
// Import imports and image into the store and returns an image
|
||||
func (ir *Runtime) Import(ctx context.Context, path, reference string, writer io.Writer, signingOptions SigningOptions, imageConfig ociv1.Image) (*Image, error) {
|
||||
file := TarballTransport + ":" + path
|
||||
src, err := alltransports.ParseImageName(file)
|
||||
src, err := tarball.Transport.ParseReference(path)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error parsing image name %q", path)
|
||||
}
|
||||
|
Reference in New Issue
Block a user